# HG changeset patch # User Evan Schoenberg # Date 1209768613 0 # Node ID d5b3afea87640b239631a447ac9420cb6acaf826 # Parent 84877c54098bcfbc80f467410e05345a7a10a2be After trying the available SASL mechs, jabber_auth_handle_failure() now proceeds to regular error handling instead of falling through to a final attempt with no remaining SASL mechs. Also, when removing a SASL mech from the js->sasl_mechs string, remove its preceding space, as well, so we can easily see if the string is empty just by checking its length. diff -r 84877c54098b -r d5b3afea8764 libpurple/protocols/jabber/auth.c --- a/libpurple/protocols/jabber/auth.c Tue Apr 29 02:01:43 2008 +0000 +++ b/libpurple/protocols/jabber/auth.c Fri May 02 22:50:13 2008 +0000 @@ -377,6 +377,10 @@ if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); } + /* Remove space which separated this mech from the next */ + if (strlen(js->sasl_mechs->str) > 0 && ((js->sasl_mechs->str)[0] == ' ')) { + g_string_erase(js->sasl_mechs, 0, 1); + } again = TRUE; } @@ -1107,12 +1111,18 @@ if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); } + /* Remove space which separated this mech from the next */ + if (strlen(js->sasl_mechs->str) > 0 && ((js->sasl_mechs->str)[0] == ' ')) { + g_string_erase(js->sasl_mechs, 0, 1); + } } - - sasl_dispose(&js->sasl); - - jabber_auth_start_cyrus(js); - return; + if (strlen(js->sasl_mechs->str)) { + /* If we have remaining mechs to try, do so */ + sasl_dispose(&js->sasl); + + jabber_auth_start_cyrus(js); + return; + } } #endif msg = jabber_parse_error(js, packet, &reason);