comparison libpurple/protocols/msn/soap.c @ 20465:2a5c1de05e0a

Fix authentication failures handling (ticket 1246) and fix some compiler warnings
author Carlos Silva <typ0@pidgin.im>
date Sat, 07 Jul 2007 19:55:14 +0000
parents 4c5d68e93ef8
children 530a92d50c5e
comparison
equal deleted inserted replaced
20460:8f7ccadce62d 20465:2a5c1de05e0a
360 error = purple_url_decode(temp); 360 error = purple_url_decode(temp);
361 g_free(temp); 361 g_free(temp);
362 } 362 }
363 } 363 }
364 364
365 msn_session_set_error(session, MSN_ERROR_SERV_UNAVAILABLE, error); 365 msn_session_set_error(session, MSN_ERROR_AUTH, error);
366 }
367 /* Handle Passport 3.0 authentication failures.
368 * Further info: http://msnpiki.msnfanatic.com/index.php/MSNP13:SOAPTweener
369 */
370 else if (strstr(soapconn->read_buf,
371 "<faultcode>wsse:FailedAuthentication</faultcode>") != NULL)
372 {
373 char *faultstring;
374
375 faultstring = strstr(soapconn->read_buf, "<faultstring>");
376
377 if (faultstring != NULL)
378 {
379 faultstring += strlen("<faultstring>");
380 *strstr(soapconn->read_buf, "</faultstring>") = '\0';
381 }
382
383 msn_session_set_error(session, MSN_ERROR_AUTH, faultstring);
366 } 384 }
367 else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable")) 385 else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable"))
368 { 386 {
369 msn_session_set_error(session, MSN_ERROR_SERV_UNAVAILABLE, NULL); 387 msn_session_set_error(session, MSN_ERROR_SERV_UNAVAILABLE, NULL);
370 } 388 }
608 "Content-Type:text/xml; charset=utf-8\r\n" 626 "Content-Type:text/xml; charset=utf-8\r\n"
609 "Cookie: MSPAuth=%s\r\n" 627 "Cookie: MSPAuth=%s\r\n"
610 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" 628 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n"
611 "Accept: */*\r\n" 629 "Accept: */*\r\n"
612 "Host: %s\r\n" 630 "Host: %s\r\n"
613 "Content-Length: %d\r\n" 631 "Content-Length: %" G_GSIZE_FORMAT "\r\n"
614 "Connection: Keep-Alive\r\n" 632 "Connection: Keep-Alive\r\n"
615 "Cache-Control: no-cache\r\n\r\n", 633 "Cache-Control: no-cache\r\n\r\n",
616 request->login_path, 634 request->login_path,
617 request->soap_action, 635 request->soap_action,
618 soapconn->session->passport_info.mspauth, 636 soapconn->session->passport_info.mspauth,