Mercurial > pidgin
comparison libpurple/protocols/msn/soap2.c @ 23445:b70f30dd4753
Patch 3 from Qulogic, this one updates contact list actions to use ticket
tokens
committer: Ka-Hing Cheung <khc@hxbc.us>
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Wed, 26 Dec 2007 00:34:50 +0000 |
parents | 8fcd795f627e |
children | bac263f5afe7 |
comparison
equal
deleted
inserted
replaced
23444:25899ec348a4 | 23445:b70f30dd4753 |
---|---|
459 443, msn_soap_connected_cb, msn_soap_error_cb, conn); | 459 443, msn_soap_connected_cb, msn_soap_error_cb, conn); |
460 } else if (conn->connected) { | 460 } else if (conn->connected) { |
461 int len = -1; | 461 int len = -1; |
462 char *body = xmlnode_to_str(req->message->xml, &len); | 462 char *body = xmlnode_to_str(req->message->xml, &len); |
463 GSList *iter; | 463 GSList *iter; |
464 char *authstr = NULL; | |
465 | 464 |
466 g_queue_pop_head(conn->queue); | 465 g_queue_pop_head(conn->queue); |
467 | 466 |
468 conn->buf = g_string_new(""); | 467 conn->buf = g_string_new(""); |
469 | |
470 if (conn->session->passport_info.mspauth) | |
471 authstr = g_strdup_printf("Cookie: MSPAuth=%s\r\n", | |
472 conn->session->passport_info.mspauth); | |
473 | |
474 | 468 |
475 g_string_append_printf(conn->buf, | 469 g_string_append_printf(conn->buf, |
476 "POST %s HTTP/1.1\r\n" | 470 "POST %s HTTP/1.1\r\n" |
477 "SOAPAction: %s\r\n" | 471 "SOAPAction: %s\r\n" |
478 "Content-Type:text/xml; charset=utf-8\r\n" | 472 "Content-Type:text/xml; charset=utf-8\r\n" |
479 "%s" | |
480 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" | 473 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" |
481 "Accept: */*\r\n" | 474 "Accept: */*\r\n" |
482 "Host: %s\r\n" | 475 "Host: %s\r\n" |
483 "Content-Length: %d\r\n" | 476 "Content-Length: %d\r\n" |
484 "Connection: Keep-Alive\r\n" | 477 "Connection: Keep-Alive\r\n" |
485 "Cache-Control: no-cache\r\n", | 478 "Cache-Control: no-cache\r\n", |
486 req->path, req->message->action ? req->message->action : "", | 479 req->path, req->message->action ? req->message->action : "", |
487 authstr ? authstr : "", conn->host, len); | 480 conn->host, len); |
488 | 481 |
489 for (iter = req->message->headers; iter; iter = iter->next) { | 482 for (iter = req->message->headers; iter; iter = iter->next) { |
490 g_string_append(conn->buf, (char *)iter->data); | 483 g_string_append(conn->buf, (char *)iter->data); |
491 g_string_append(conn->buf, "\r\n"); | 484 g_string_append(conn->buf, "\r\n"); |
492 } | 485 } |
501 | 494 |
502 conn->event_handle = purple_input_add(conn->ssl->fd, | 495 conn->event_handle = purple_input_add(conn->ssl->fd, |
503 PURPLE_INPUT_WRITE, msn_soap_write_cb, conn); | 496 PURPLE_INPUT_WRITE, msn_soap_write_cb, conn); |
504 msn_soap_write_cb(conn, conn->ssl->fd, PURPLE_INPUT_WRITE); | 497 msn_soap_write_cb(conn, conn->ssl->fd, PURPLE_INPUT_WRITE); |
505 | 498 |
506 g_free(authstr); | |
507 g_free(body); | 499 g_free(body); |
508 } | 500 } |
509 } | 501 } |
510 | 502 |
511 return FALSE; | 503 return FALSE; |