Better handle the case where a list in an IMAP response is prematurely ended by CRLF.

Fixes issue 2852
This commit is contained in:
cketti 2011-01-11 03:10:24 +00:00
parent b4635e53b5
commit c7a7d832e7

View file

@ -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("]"))
{