diff options
author | Jiri Hruska <jirka@fud.cz> | 2013-02-24 13:27:49 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-02-24 12:39:09 +0000 |
commit | 797b004738407a88e4891ab6fe0d9ab62f621427 (patch) | |
tree | 423bf5486770e18d12e1dd37695e32eb29713193 /lib | |
parent | 1ff6a8338df31c1153d6627e4b7b42e90b34d9ab (diff) |
imap: Reworked the logic of untagged command responses
Diffstat (limited to 'lib')
-rw-r--r-- | lib/imap.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/imap.c b/lib/imap.c index ba1f6fd8b..b2c97136d 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -360,10 +360,10 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, return TRUE; } - /* Are we processing CAPABILITY command data? */ - if(imapc->state == IMAP_CAPABILITY) { - /* Do we have a valid response? */ - if(len >= 2 && !memcmp("* ", line, 2)) { + /* Do we have an untagged command response */ + if(len >= 2 && !memcmp("* ", line, 2)) { + /* Are we processing CAPABILITY command data? */ + if(imapc->state == IMAP_CAPABILITY) { line += 2; len -= 2; @@ -425,11 +425,8 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, len -= wordlen; } } - } - /* Are we processing FETCH command responses? */ - else if(imapc->state == IMAP_FETCH) { - /* Do we have a valid response? */ - if(len >= 2 && !memcmp("* ", line, 2)) { + /* Are we processing FETCH command responses? */ + else if(imapc->state == IMAP_FETCH) { *resp = '*'; return TRUE; |