pidgin: 1724c0c7: Very hackily implement a fallback mechan...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sun Jun 13 20:10:49 EDT 2010


-----------------------------------------------------------------
Revision: 1724c0c7cbf56b08b5454e796b80173ec9aef481
Ancestor: 7f18d445cdefc8ed3f973f00e9d2176eebf75bd4
Author: rekkanoryo at pidgin.im
Date: 2010-06-13T23:07:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1724c0c7cbf56b08b5454e796b80173ec9aef481

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

ChangeLog: 

Very hackily implement a fallback mechanism in Yahoo, but not for Yahoo Japan
because we don't know hosts we can fall back to there yet.  This fallback
mechanism just blindly connects to scsa.msg.yahoo.com if the HTTP-based CS
lookup fails.  I guarantee this will break in the future.  Refs #11986.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	10e1f954fa17346bfe6febf9f63e94fad26de543
+++ libpurple/protocols/yahoo/libymsg.c	048656e6bbe4958a2ecaeac7f596cb934b8f7b80
@@ -3602,8 +3602,17 @@ static void yahoo_got_pager_server(Purpl
 		purple_debug_error("yahoo", "Unable to retrieve server info. %"
 				G_GSIZE_FORMAT " bytes retrieved with error message: %s\n", len,
 				error_message ? error_message : "(null)");
-		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Unable to connect: The server returned an empty response."));
+
+		if(yahoo_is_japan(a)) { /* We don't know fallback hosts for Yahoo Japan :( */
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+					_("Unable to connect: The server returned an empty response."));
+		} else {
+				if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
+							yahoo_got_connected, gc) == NULL) {
+					purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+							_("Unable to connect"));
+				}
+		}
 	} else {
 		strings = g_strsplit(url_text, "\r\n", -1);
 
@@ -3629,9 +3638,17 @@ static void yahoo_got_pager_server(Purpl
 		} else {
 			purple_debug_error("yahoo", "No CS address retrieved!  Server "
 					"response:\n%s\n", url_text ? url_text : "(null)");
-			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-					_("Unable to connect: The server's response did not contain "
-						"the necessary information"));
+
+			if(yahoo_is_japan(a)) { /* We don't know fallback hosts for Yahoo Japan :( */
+				purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+						_("Unable to connect: The server's response did not contain "
+							"the necessary information"));
+			} else
+				if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
+							yahoo_got_connected, gc) == NULL) {
+					purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+							_("Unable to connect"));
+				}
 		}
 	}
 
============================================================
--- libpurple/protocols/yahoo/libymsg.h	42ea038bc0dea38c8052be92b166322a6308d8f4
+++ libpurple/protocols/yahoo/libymsg.h	4d92455a28672f64f4e44567a24889776d720d01
@@ -30,6 +30,7 @@
 #include "prpl.h"
 
 #define YAHOO_PAGER_HOST_REQ_URL "http://vcs1.msg.yahoo.com/capacity"
+#define YAHOO_PAGER_HOST_FALLBACK "scsa.msg.yahoo.com"
 #define YAHOO_PAGER_PORT 5050
 #define YAHOO_PAGER_PORT_P2P 5101
 #define YAHOO_LOGIN_URL "https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%s"


More information about the Commits mailing list