pidgin: 4fd76da7: Fix how we process certain data we get f...

sadrul at pidgin.im sadrul at pidgin.im
Tue Jun 30 16:55:36 EDT 2009


-----------------------------------------------------------------
Revision: 4fd76da73829784c6ce186ad461abef56804b449
Ancestor: 237cf4e06a6b94e637978e489ea7936ef3d2ad2d
Author: sadrul at pidgin.im
Date: 2009-06-30T20:50:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/4fd76da73829784c6ce186ad461abef56804b449

Modified files:
        libpurple/protocols/yahoo/yahoo.c

ChangeLog: 

Fix how we process certain data we get from the server.

In some cases, we seem to take into account that the server does send us
chunked data, but not always. Now that the core handles chunked data, we
can process the response data more correctly.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	39bb38982cbbd8c353a4db536f653d60d2491988
+++ libpurple/protocols/yahoo/yahoo.c	19b6a0ebe6600c07ba26b7312b3b92fdf0e5edd5
@@ -1683,11 +1683,11 @@ static void yahoo_auth16_stage2(PurpleUt
 #else
 		while (split_data[++totalelements] != NULL);	
 #endif
-		if (totalelements >= 5) {
-			response_no = strtol(split_data[1], NULL, 10);
-			crumb = g_strdup(split_data[2] + strlen("crumb="));
-			yd->cookie_y = g_strdup(split_data[3] + strlen("Y="));
-			yd->cookie_t = g_strdup(split_data[4] + strlen("T="));
+		if (totalelements >= 4) {
+			response_no = strtol(split_data[0], NULL, 10);
+			crumb = g_strdup(split_data[1] + strlen("crumb="));
+			yd->cookie_y = g_strdup(split_data[2] + strlen("Y="));
+			yd->cookie_t = g_strdup(split_data[3] + strlen("T="));
 		}
 
 		g_strfreev(split_data);
@@ -1769,9 +1769,9 @@ static void yahoo_auth16_stage1_cb(Purpl
 #else
 		while (split_data[++totalelements] != NULL);	
 #endif
-		if(totalelements >= 5) {
-			response_no = strtol(split_data[1], NULL, 10);
-			token = g_strdup(split_data[2] + strlen("ymsgr="));
+		if(totalelements >= 2) {
+			response_no = strtol(split_data[0], NULL, 10);
+			token = g_strdup(split_data[1] + strlen("ymsgr="));
 		}
 
 		g_strfreev(split_data);


More information about the Commits mailing list