Better handle the case where a list in an IMAP response is prematurely ended by CRLF.
Fixes issue 2852
This commit is contained in:
parent
b4635e53b5
commit
c7a7d832e7
1 changed files with 13 additions and 3 deletions
|
@ -56,6 +56,7 @@ public class ImapResponseParser
|
|||
{
|
||||
response.mCommandContinuationRequested =
|
||||
parseCommandContinuationRequest();
|
||||
//TODO: Add special "resp-text" parsing
|
||||
readTokens(response);
|
||||
}
|
||||
else
|
||||
|
@ -89,8 +90,17 @@ public class ImapResponseParser
|
|||
{
|
||||
response.add(token);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Check for responses ("OK", "PREAUTH", "BYE", "NO", "BAD")
|
||||
* that can contain resp-text tokens. If found, hand over to a special
|
||||
* method that parses a resp-text token. There's no need to use
|
||||
* readToken()/parseToken() on that data.
|
||||
*
|
||||
* See RFC 3501, §9 Formal Syntax (resp-text)
|
||||
*/
|
||||
}
|
||||
response.mCompleted = token == null;
|
||||
response.mCompleted = (token == null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -204,7 +214,7 @@ public class ImapResponseParser
|
|||
token = parseToken(list);
|
||||
if (token == null)
|
||||
{
|
||||
break;
|
||||
return null;
|
||||
}
|
||||
else if (token.equals(")"))
|
||||
{
|
||||
|
@ -233,7 +243,7 @@ public class ImapResponseParser
|
|||
token = parseToken(list);
|
||||
if (token == null)
|
||||
{
|
||||
break;
|
||||
return null;
|
||||
}
|
||||
else if (token.equals("]"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue