comparison libpurple/protocols/msn/soap.c @ 20489:321d25932f5e

Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
author Carlos Silva <typ0@pidgin.im>
date Mon, 03 Sep 2007 20:32:57 +0000
parents eb93710aec4d
children 2d8999540239
comparison
equal deleted inserted replaced
20488:64c322c3b1b0 20489:321d25932f5e
632 632
633 /*post the soap request queue's head request*/ 633 /*post the soap request queue's head request*/
634 void 634 void
635 msn_soap_post_head_request(MsnSoapConn *soapconn) 635 msn_soap_post_head_request(MsnSoapConn *soapconn)
636 { 636 {
637 purple_debug_info("MSN SOAP", "Posting new request from head of the queue\n");
638
637 g_return_if_fail(soapconn->soap_queue != NULL); 639 g_return_if_fail(soapconn->soap_queue != NULL);
638 640
639 if(!g_queue_is_empty(soapconn->soap_queue)){ 641 if(!g_queue_is_empty(soapconn->soap_queue)){
640 MsnSoapReq *request; 642 MsnSoapReq *request;
641 if((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){ 643 if((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){
642 msn_soap_post_request(soapconn,request); 644 msn_soap_post_request(soapconn,request);
643 } 645 }
644 } 646 } else {
645 msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED_IDLE); 647 purple_debug_info("MSN SOAP", "No requests to process found.\n");
648 msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED_IDLE);
649 }
646 } 650 }
647 651
648 /*post the soap request , 652 /*post the soap request ,
649 * if not connected, Connected first. 653 * if not connected, Connected first.
650 */ 654 */
668 /*if connected, what we only needed to do is to queue the request, 672 /*if connected, what we only needed to do is to queue the request,
669 * when SOAP request in the queue processed done, will do this command. 673 * when SOAP request in the queue processed done, will do this command.
670 * we just waiting... 674 * we just waiting...
671 * If we send the request this time,error may occure 675 * If we send the request this time,error may occure
672 */ 676 */
673 #if 0 677 if (soapconn->step == MSN_SOAP_CONNECTED_IDLE){
674 if(soapconn->step == MSN_SOAP_CONNECTED_IDLE){
675 msn_soap_post_head_request(soapconn); 678 msn_soap_post_head_request(soapconn);
676 } 679 }
677 #endif
678 } 680 }
679 681
680 /*Post the soap request action*/ 682 /*Post the soap request action*/
681 void 683 void
682 msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request) 684 msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request)
688 xmlnode * node; 690 xmlnode * node;
689 #endif 691 #endif
690 purple_debug_misc("MSN SOAP","msn_soap_post_request()\n"); 692 purple_debug_misc("MSN SOAP","msn_soap_post_request()\n");
691 #endif 693 #endif
692 694
693 msn_soap_set_process_step(soapconn,MSN_SOAP_PROCESSING); 695 msn_soap_set_process_step(soapconn, MSN_SOAP_PROCESSING);
694 soap_head = g_strdup_printf( 696 soap_head = g_strdup_printf(
695 "POST %s HTTP/1.1\r\n" 697 "POST %s HTTP/1.1\r\n"
696 "SOAPAction: %s\r\n" 698 "SOAPAction: %s\r\n"
697 "Content-Type:text/xml; charset=utf-8\r\n" 699 "Content-Type:text/xml; charset=utf-8\r\n"
698 "Cookie: MSPAuth=%s\r\n" 700 "Cookie: MSPAuth=%s\r\n"