From: Matthias A. <mat...@gm...> - 2010-01-22 02:20:46
|
Dear Sunil, dear readers, Am 18.01.2010, 09:32 Uhr, schrieb Sunil Shetye <sh...@bo...>: > Quoting from Matthias Andree's mail on Thu, Jan 14, 2010: >> Perhaps a separate imap_untagged_parse() function would be more >> suitable here, >> and possibly called from inside imap_ok()? See below. > > Ok, I have made a separate imap_untagged_response() to parse the > untagged response. Other key changes: > > - use stage == STAGE_GETAUTH && !strncmp(buf, "* CAPABILITY", 12) > - instead of strstr(buf, " CAPABILITY") > > - use stage == STAGE_GETAUTH && !strncmp(buf, "* PREAUTH", 9) > - instead of strstr(buf, " PREAUTH") > > - use stage == STAGE_GETRANGE && !check_only && strstr(buf, > "[READ-ONLY]") > - instead of !check_only && strstr(buf, "[READ-ONLY]") > > - log "* BYE" message > > > These changes should save a lot of string comparisons during runtime. OK, makes sense (plus we don't want these anywhere on the line but just after the non-tag). > In order to address this, I have made one more intermediate function > imap_response(). Caller-specific parsers will call imap_response() in > a loop and others will continue calling imap_ok(). Good. > Please check if this patch addresses all the issues raised. To me it seems fine, based on the testing that you and Matt have been doing, I've committed the change (r5459). Thanks to the two of you, and to Timo Sirainen, for the help with resolving this issue. Best regards Matthias |