changeset 22795:42dfa1139b5c

merge of '21d37789f674809d615fc7676a092f1da438b0f5' and 'aafbbc317ab5f69e31e0bb6cabc264bb70745ef2'
author Evan Schoenberg <evan.s@dreskin.net>
date Fri, 02 May 2008 22:51:14 +0000
parents d5b3afea8764 (diff) 0d7ceae153bd (current diff)
children 5e6b42e77fb7
files libpurple/protocols/jabber/auth.c
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Fri May 02 22:01:01 2008 +0000
+++ b/libpurple/protocols/jabber/auth.c	Fri May 02 22:51:14 2008 +0000
@@ -382,6 +382,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;
 				}
 
@@ -1112,12 +1116,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);