Changeset 4aa8a04 for protocols/msn/soap.c
- Timestamp:
- 2010-09-04T15:54:52Z (14 years ago)
- Branches:
- master
- Children:
- 27053b5
- Parents:
- bae0617
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/soap.c
rbae0617 r4aa8a04 137 137 { 138 138 struct xt_parser *parser; 139 struct xt_node *err; 139 140 140 141 parser = xt_new( soap_req->xml_parser, soap_req ); 141 142 xt_feed( parser, http_req->reply_body, http_req->body_size ); 143 if( http_req->status_code == 500 && 144 ( err = xt_find_path( parser->root, "soap:Body/soap:Fault/detail/errorcode" ) ) && 145 err->text_len > 0 && strcmp( err->text, "PassportAuthFail" ) == 0 ) 146 { 147 struct msn_data *md = soap_req->ic->proto_data; 148 149 xt_free( parser ); 150 if( md->auth->fd == -1 ) 151 msn_ns_connect( soap_req->ic, md->auth, MSN_NS_HOST, MSN_NS_PORT ); 152 md->soapq = g_slist_prepend( md->soapq, soap_req ); 153 154 return; 155 } 156 142 157 xt_handle( parser, NULL, -1 ); 143 158 xt_free( parser ); … … 202 217 } 203 218 219 static int msn_soapq_empty( struct im_connection *ic ) 220 { 221 struct msn_data *md = ic->proto_data; 222 223 while( md->soapq ) 224 { 225 msn_soap_send_request( (struct msn_soap_req_data*) md->soapq->data ); 226 md->soapq = g_slist_remove( md->soapq, md->soapq->data ); 227 } 228 229 return MSN_SOAP_OK; 230 } 231 204 232 205 233 /* passport_sso: Authentication MSNP15+ */ … … 207 235 struct msn_soap_passport_sso_data 208 236 { 209 char *policy;210 237 char *nonce; 211 238 char *secret; … … 217 244 struct msn_soap_passport_sso_data *sd = soap_req->data; 218 245 struct im_connection *ic = soap_req->ic; 246 struct msn_data *md = ic->proto_data; 219 247 220 248 if( g_str_has_suffix( ic->acc->user, "@msn.com" ) ) … … 224 252 225 253 soap_req->payload = g_markup_printf_escaped( SOAP_PASSPORT_SSO_PAYLOAD, 226 ic->acc->user, ic->acc->pass, sd->policy );254 ic->acc->user, ic->acc->pass, md->pp_policy ); 227 255 228 256 return MSN_SOAP_OK; … … 301 329 struct msn_soap_passport_sso_data *sd = soap_req->data; 302 330 struct im_connection *ic = soap_req->ic; 331 struct msn_data *md = ic->proto_data; 303 332 char *key1, *key2, *key3, *blurb64; 304 333 int key1_len; … … 326 355 }; 327 356 357 if( md->soapq ) 358 return msn_soapq_empty( ic ); 359 328 360 if( sd->secret == NULL ) 329 361 { … … 364 396 struct msn_soap_passport_sso_data *sd = soap_req->data; 365 397 366 g_free( sd->policy );367 398 g_free( sd->nonce ); 368 399 g_free( sd->secret ); … … 372 403 } 373 404 374 int msn_soap_passport_sso_request( struct im_connection *ic, const char * policy, const char *nonce )405 int msn_soap_passport_sso_request( struct im_connection *ic, const char *nonce ) 375 406 { 376 407 struct msn_soap_passport_sso_data *sd = g_new0( struct msn_soap_passport_sso_data, 1 ); 377 408 378 sd->policy = g_strdup( policy );379 409 sd->nonce = g_strdup( nonce ); 380 410
Note: See TracChangeset
for help on using the changeset viewer.