pidgin: cea0a941: oscar: According to the online docs, sta...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Nov 6 16:22:00 EST 2009


-----------------------------------------------------------------
Revision: cea0a94190c6ddf69977976b807b9bc5aa880987
Ancestor: a535eaf410df85f6935856ff171f8980b5ee192a
Author: darkrain42 at pidgin.im
Date: 2009-11-06T18:12:01
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/cea0a94190c6ddf69977976b807b9bc5aa880987

Modified files:
        libpurple/protocols/oscar/clientlogin.c

ChangeLog: 

oscar: According to the online docs, statusCode 607 is rate limit (confirmed
by my "tests" and Adium#13368c5. 401 is supposedly "Authorization required",
but I've left in that anyway.

http://dev.aol.com/aim/web/serverapi_reference#startOSCARSession

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/clientlogin.c	b1c91733c78e26d7696fbf1567054c6c705db1c8
+++ libpurple/protocols/oscar/clientlogin.c	f63fb2d83f62efa4d1085fbceac85da68fd46282
@@ -109,6 +109,7 @@ static gboolean parse_start_oscar_sessio
 	xmlnode *host_node = NULL, *port_node = NULL, *cookie_node = NULL, *tls_node = NULL;
 	gboolean use_tls;
 	char *tmp;
+	guint code;
 
 	use_tls = purple_account_get_bool(purple_connection_get_account(gc), "use_ssl", OSCAR_DEFAULT_USE_SSL);
 
@@ -153,12 +154,13 @@ static gboolean parse_start_oscar_sessio
 	}
 
 	/* Make sure the status code was 200 */
-	if (strcmp(tmp, "200") != 0)
+	code = atoi(tmp);
+	if (code != 200)
 	{
 		purple_debug_error("oscar", "startOSCARSession response statusCode "
 				"was %s: %s\n", tmp, response);
 
-		if (strcmp(tmp, "401") == 0)
+		if (code == 401 || code == 607)
 			purple_connection_error_reason(gc,
 					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 					_("You have been connecting and disconnecting too "


More information about the Commits mailing list