# HG changeset patch # User Carlos Silva # Date 1183838114 0 # Node ID 2a5c1de05e0a3058194d55d56f9934ebafe4f10b # Parent 8f7ccadce62dd2199bf2faa6713ddb7ae70f20ab Fix authentication failures handling (ticket 1246) and fix some compiler warnings diff -r 8f7ccadce62d -r 2a5c1de05e0a libpurple/protocols/msn/soap.c --- a/libpurple/protocols/msn/soap.c Thu Jul 05 06:48:38 2007 +0000 +++ b/libpurple/protocols/msn/soap.c Sat Jul 07 19:55:14 2007 +0000 @@ -362,7 +362,25 @@ } } - msn_session_set_error(session, MSN_ERROR_SERV_UNAVAILABLE, error); + msn_session_set_error(session, MSN_ERROR_AUTH, error); + } + /* Handle Passport 3.0 authentication failures. + * Further info: http://msnpiki.msnfanatic.com/index.php/MSNP13:SOAPTweener + */ + else if (strstr(soapconn->read_buf, + "wsse:FailedAuthentication") != NULL) + { + char *faultstring; + + faultstring = strstr(soapconn->read_buf, ""); + + if (faultstring != NULL) + { + faultstring += strlen(""); + *strstr(soapconn->read_buf, "") = '\0'; + } + + msn_session_set_error(session, MSN_ERROR_AUTH, faultstring); } else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable")) { @@ -610,7 +628,7 @@ "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" "Accept: */*\r\n" "Host: %s\r\n" - "Content-Length: %d\r\n" + "Content-Length: %" G_GSIZE_FORMAT "\r\n" "Connection: Keep-Alive\r\n" "Cache-Control: no-cache\r\n\r\n", request->login_path,