From f581a61e4a10320915a766530b9eb01ea4ee63ab Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 11 Jun 2004 01:36:16 +0000 Subject: Don't always try and parse a RESP-CODE in the BYE case as the RESP-CODE is 2004-06-10 Jeffrey Stedfast * providers/imap4/camel-imap4-engine.c (camel_imap4_engine_handle_untagged_1): Don't always try and parse a RESP-CODE in the BYE case as the RESP-CODE is optional. svn path=/trunk/; revision=26297 --- camel/providers/imap4/camel-imap4-engine.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'camel/providers/imap4') diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c index 059c7dbe22..bd5ebfff07 100644 --- a/camel/providers/imap4/camel-imap4-engine.c +++ b/camel/providers/imap4/camel-imap4-engine.c @@ -978,7 +978,15 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke if (token->token == CAMEL_IMAP4_TOKEN_ATOM) { if (!strcmp ("BYE", token->v.atom)) { /* we don't care if we fail here, either way we've been disconnected */ - camel_imap4_engine_parse_resp_code (engine, NULL); + if (camel_imap4_engine_next_token (engine, token, NULL) == 0) { + if (token->token == '[') { + camel_imap4_stream_unget_token (engine->istream, token); + camel_imap4_engine_parse_resp_code (engine, NULL); + } else { + camel_imap4_engine_line (engine, NULL, NULL, NULL); + } + } + engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED; /* FIXME: emit a "disconnected" signal for our Store? -- cgit