# HG changeset patch # User John Bailey # Date 1276470444 0 # Node ID e9001aa49be86aa8c5b2e3b19937df4a8eebe548 # Parent c3b77c0fa79c143264ba15324344546be2552fd2 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. diff -r c3b77c0fa79c -r e9001aa49be8 libpurple/protocols/yahoo/libymsg.c --- 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")); + } } } diff -r c3b77c0fa79c -r e9001aa49be8 libpurple/protocols/yahoo/libymsg.h --- a/libpurple/protocols/yahoo/libymsg.h Sun Jun 13 05:44:13 2010 +0000 +++ b/libpurple/protocols/yahoo/libymsg.h Sun Jun 13 23:07:24 2010 +0000 @@ -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"