diff libpurple/protocols/yahoo/libymsg.c @ 30607:e9001aa49be8

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.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 13 Jun 2010 23:07:24 +0000
parents 27aff21c5eea
children 50380b60aa56
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/libymsg.c	Sun Jun 13 05:44:13 2010 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Sun Jun 13 23:07:24 2010 +0000
@@ -3602,8 +3602,17 @@
 		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 @@
 		} 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"));
+				}
 		}
 	}