# HG changeset patch # User Ka-Hing Cheung # Date 1179614931 0 # Node ID dc042f70bd8c03fdf932f9fa45400d87c0c7e587 # Parent 4c5d68e93ef8e02a3dc31651775b426de3fd5e1d# Parent 6f3432091d4bcdaa06c5cf0d287c009f80a40cb4 merge of '04f3de66fbed599e51f30258916fdb8f966ffdcd' and 'b92b51d5aa18a5df8e4de6cfd0c4710845197b51' diff -r 6f3432091d4b -r dc042f70bd8c COPYRIGHT --- a/COPYRIGHT Mon May 14 19:38:13 2007 +0000 +++ b/COPYRIGHT Sat May 19 22:48:51 2007 +0000 @@ -260,6 +260,7 @@ Ted Percival Eduardo Pérez Matt Perry +Sebastián E. Peyrott Celso Pinto Joao Luís Marques Pinto Aleksander Piotrowski diff -r 6f3432091d4b -r dc042f70bd8c libpurple/protocols/msn/soap.c --- a/libpurple/protocols/msn/soap.c Mon May 14 19:38:13 2007 +0000 +++ b/libpurple/protocols/msn/soap.c Sat May 19 22:48:51 2007 +0000 @@ -302,6 +302,43 @@ PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb, soapconn); } + /* Another case of redirection, active on May, 2007 + See http://msnpiki.msnfanatic.com/index.php/MSNP13:SOAPTweener#Redirect + */ + else if (strstr(soapconn->read_buf, + "psf:Redirect") != NULL) + { + char *location, *c; + + location = strstr(soapconn->read_buf, ""); + /* Omit the tag preceding the URL */ + location += strlen(""); + location = strstr(location, ":/"); + if (location == NULL) + { + msn_soap_free_read_buf(soapconn); + return; + } + + location += strlen("://"); /* Skip http:// or https:// */ + + if ( (c = strstr(location, "")) != NULL ) + *c = '\0'; + + if ( (c = strstr(location, "/")) != NULL ) + { + g_free(soapconn->login_path); + soapconn->login_path = g_strdup(c); + *c = '\0'; + } + + g_free(soapconn->login_host); + soapconn->login_host = g_strdup(location); + + purple_ssl_connect(session->account, soapconn->login_host, + PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, + msn_soap_error_cb, soapconn); + } else if (strstr(soapconn->read_buf, "HTTP/1.1 401 Unauthorized") != NULL) { const char *error;