1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Fixed a bug in the IMAP response parser

Also got rid of ImapResponse.more() which isn't necessary anymore.
This commit is contained in:
cketti 2012-01-12 07:56:52 +01:00
parent ad8b025b6f
commit 66b7805a57
2 changed files with 6 additions and 22 deletions

View File

@ -79,7 +79,6 @@ public class ImapResponseParser {
} }
} }
} }
response.mCompleted = true;
} }
/** /**
@ -480,33 +479,23 @@ public class ImapResponseParser {
} }
/** /**
* Represents a single response from the IMAP server. Tagged responses will * Represents a single response from the IMAP server.
* have a non-null tag. Untagged responses will have a null tag. The object *
* will contain all of the available tokens at the time the response is * <p>
* received. In general, it will either contain all of the tokens of the * Tagged responses will have a non-null tag. Untagged responses will have a null tag. The
* response or all of the tokens up until the first LITERAL. If the object * object will contain all of the available tokens at the time the response is received.
* does not contain the entire response the caller must call more() to * </p>
* continue reading the response until more returns false.
*/ */
public class ImapResponse extends ImapList { public class ImapResponse extends ImapList {
/** /**
* *
*/ */
private static final long serialVersionUID = 6886458551615975669L; private static final long serialVersionUID = 6886458551615975669L;
private boolean mCompleted;
private IImapResponseCallback mCallback; private IImapResponseCallback mCallback;
boolean mCommandContinuationRequested; boolean mCommandContinuationRequested;
String mTag; String mTag;
public boolean more() throws IOException {
if (mCompleted) {
return false;
}
readTokens(this);
return true;
}
public String getAlertText() { public String getAlertText() {
if (size() > 1 && equalsIgnoreCase("[ALERT]", get(1))) { if (size() > 1 && equalsIgnoreCase("[ALERT]", get(1))) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

View File

@ -1450,8 +1450,6 @@ public class ImapStore extends Store {
handleUntaggedResponse(response); handleUntaggedResponse(response);
} }
while (response.more());
} while (response.mTag == null); } while (response.mTag == null);
} catch (IOException ioe) { } catch (IOException ioe) {
throw ioExceptionHandler(mConnection, ioe); throw ioExceptionHandler(mConnection, ioe);
@ -1535,8 +1533,6 @@ public class ImapStore extends Store {
handleUntaggedResponse(response); handleUntaggedResponse(response);
} }
while (response.more());
} while (response.mTag == null); } while (response.mTag == null);
} catch (IOException ioe) { } catch (IOException ioe) {
throw ioExceptionHandler(mConnection, ioe); throw ioExceptionHandler(mConnection, ioe);
@ -1877,7 +1873,6 @@ public class ImapStore extends Store {
eolOut.write('\n'); eolOut.write('\n');
eolOut.flush(); eolOut.flush();
} }
while (response.more());
} while (response.mTag == null); } while (response.mTag == null);
String newUid = getUidFromMessageId(message); String newUid = getUidFromMessageId(message);