comparison libpurple/protocols/msn/soap.c @ 20501:f6dff814d95f

cleans up ownership of soap callback data, this soap stuff is perfect weight-loss pill, because it makes you want to throw up
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 09 Sep 2007 01:42:46 +0000
parents f062793410b5
children 915e11fbaeb0 2c8c6d77f12c
comparison
equal deleted inserted replaced
20500:403ff626b803 20501:f6dff814d95f
148 { 148 {
149 MsnSoapReq *request; 149 MsnSoapReq *request;
150 150
151 g_return_if_fail(soapconn != NULL); 151 g_return_if_fail(soapconn != NULL);
152 152
153 soapconn->body = NULL;
154
153 while ((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){ 155 while ((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){
156 if (soapconn->read_cb) {
157 soapconn->read_cb(soapconn, -1, 0);
158 }
154 msn_soap_request_free(request); 159 msn_soap_request_free(request);
155 } 160 }
156 } 161 }
157 162
158 /*destroy the soap connection*/ 163 /*destroy the soap connection*/
508 } 513 }
509 soapconn->write_buf = NULL; 514 soapconn->write_buf = NULL;
510 soapconn->written_len = 0; 515 soapconn->written_len = 0;
511 } 516 }
512 517
513 void
514 msn_soap_free_data_cb(MsnSoapConn *soapconn)
515 {
516 if (soapconn->data_cb) {
517 g_free(soapconn->data_cb);
518 }
519 }
520
521 /*Soap write process func*/ 518 /*Soap write process func*/
522 static void 519 static void
523 msn_soap_write_cb(gpointer data, gint source, PurpleInputCondition cond) 520 msn_soap_write_cb(gpointer data, gint source, PurpleInputCondition cond)
524 { 521 {
525 MsnSoapConn *soapconn = data; 522 MsnSoapConn *soapconn = data;
623 620
624 g_free(request->login_host); 621 g_free(request->login_host);
625 g_free(request->login_path); 622 g_free(request->login_path);
626 g_free(request->soap_action); 623 g_free(request->soap_action);
627 g_free(request->body); 624 g_free(request->body);
628 g_free(request->data_cb);
629 request->read_cb = NULL; 625 request->read_cb = NULL;
630 request->written_cb = NULL; 626 request->written_cb = NULL;
631 627
632 g_free(request); 628 g_free(request);
633 } 629 }