19784
|
1 /**
|
|
2 * @file soap.c
|
|
3 * SOAP connection related process
|
|
4 * Author
|
|
5 * MaYuan<mayuan2006@gmail.com>
|
|
6 * gaim
|
|
7 *
|
|
8 * Gaim is the legal property of its developers, whose names are too numerous
|
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this
|
|
10 * source distribution.
|
|
11 *
|
|
12 * This program is free software; you can redistribute it and/or modify
|
|
13 * it under the terms of the GNU General Public License as published by
|
|
14 * the Free Software Foundation; either version 2 of the License, or
|
|
15 * (at your option) any later version.
|
|
16 *
|
|
17 * This program is distributed in the hope that it will be useful,
|
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 * GNU General Public License for more details.
|
|
21 *
|
|
22 * You should have received a copy of the GNU General Public License
|
|
23 * along with this program; if not, write to the Free Software
|
|
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25 */
|
|
26 #include "msn.h"
|
|
27 #include "soap.h"
|
|
28
|
19807
|
29 /*setup the soap process step*/
|
19806
|
30 void
|
|
31 msn_soap_set_process_step(MsnSoapConn *soapconn, MsnSoapStep step)
|
|
32 {
|
|
33 soapconn->step = step;
|
|
34 }
|
|
35
|
19785
|
36 //msn_soap_new(MsnSession *session,gpointer data,int sslconn)
|
19784
|
37 /*new a soap connection*/
|
|
38 MsnSoapConn *
|
19785
|
39 msn_soap_new(MsnSession *session,gpointer data,int sslconn)
|
19784
|
40 {
|
|
41 MsnSoapConn *soapconn;
|
|
42
|
|
43 soapconn = g_new0(MsnSoapConn, 1);
|
|
44 soapconn->session = session;
|
19785
|
45 soapconn->parent = data;
|
|
46 soapconn->ssl_conn = sslconn;
|
|
47
|
|
48 soapconn->gsc = NULL;
|
19784
|
49 soapconn->input_handler = -1;
|
|
50 soapconn->output_handler = -1;
|
19804
|
51
|
19806
|
52 msn_soap_set_process_step(soapconn,MSN_SOAP_UNCONNECTED);
|
19804
|
53 soapconn->soap_queue = g_queue_new();
|
19784
|
54 return soapconn;
|
|
55 }
|
|
56
|
|
57 /*ssl soap connect callback*/
|
|
58 void
|
|
59 msn_soap_connect_cb(gpointer data, GaimSslConnection *gsc,
|
|
60 GaimInputCondition cond)
|
|
61 {
|
|
62 MsnSoapConn * soapconn;
|
|
63 MsnSession *session;
|
|
64
|
|
65 gaim_debug_info("MaYuan","Soap connection connected!\n");
|
|
66 soapconn = data;
|
|
67 g_return_if_fail(soapconn != NULL);
|
|
68
|
|
69 session = soapconn->session;
|
|
70 g_return_if_fail(session != NULL);
|
|
71
|
|
72 soapconn->gsc = gsc;
|
|
73
|
|
74 /*connection callback*/
|
|
75 if(soapconn->connect_cb != NULL){
|
|
76 soapconn->connect_cb(data,gsc,cond);
|
|
77 }
|
19804
|
78
|
19806
|
79 msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED);
|
19804
|
80 /*we do the SOAP request here*/
|
|
81 msn_soap_post_head_request(soapconn);
|
19784
|
82 }
|
|
83
|
|
84 /*ssl soap error callback*/
|
|
85 static void
|
|
86 msn_soap_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data)
|
|
87 {
|
|
88 MsnSoapConn * soapconn = data;
|
|
89 g_return_if_fail(data != NULL);
|
|
90 gaim_debug_info("MaYuan","Soap connection error!\n");
|
|
91 /*error callback*/
|
|
92 if(soapconn->error_cb != NULL){
|
|
93 soapconn->error_cb(gsc,error,data);
|
|
94 }
|
19806
|
95 msn_soap_set_process_step(soapconn, MSN_SOAP_UNCONNECTED);
|
19784
|
96 }
|
|
97
|
|
98 /*init the soap connection*/
|
|
99 void
|
|
100 msn_soap_init(MsnSoapConn *soapconn,char * host,int ssl,
|
|
101 GaimSslInputFunction connect_cb,
|
|
102 GaimSslErrorFunction error_cb)
|
|
103 {
|
19808
|
104 gaim_debug_info("MaYuan","msn_soap_init...\n");
|
19784
|
105 soapconn->login_host = g_strdup(host);
|
|
106 soapconn->ssl_conn = ssl;
|
|
107 soapconn->connect_cb = connect_cb;
|
|
108 soapconn->error_cb = error_cb;
|
19808
|
109 gaim_debug_info("MaYuan","msn_soap_init...done\n");
|
19804
|
110 }
|
|
111
|
19806
|
112 /*connect the soap connection*/
|
19804
|
113 void
|
|
114 msn_soap_connect(MsnSoapConn *soapconn)
|
|
115 {
|
19784
|
116 if(soapconn->ssl_conn){
|
|
117 gaim_ssl_connect(soapconn->session->account, soapconn->login_host,
|
|
118 GAIM_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb,
|
|
119 soapconn);
|
|
120 }else{
|
|
121 }
|
|
122 }
|
|
123
|
19806
|
124 /*close the soap connection*/
|
19804
|
125 void
|
|
126 msn_soap_close(MsnSoapConn *soapconn)
|
|
127 {
|
|
128 if(soapconn->ssl_conn){
|
|
129 if(soapconn->gsc != NULL){
|
|
130 gaim_ssl_close(soapconn->gsc);
|
|
131 soapconn->gsc = NULL;
|
|
132 }
|
|
133 }else{
|
|
134 }
|
19806
|
135 msn_soap_set_process_step(soapconn,MSN_SOAP_UNCONNECTED);
|
19804
|
136 }
|
|
137
|
19784
|
138 /*destroy the soap connection*/
|
|
139 void
|
|
140 msn_soap_destroy(MsnSoapConn *soapconn)
|
|
141 {
|
19804
|
142 MsnSoapReq *request;
|
|
143
|
19791
|
144 if(soapconn->login_host)
|
|
145 g_free(soapconn->login_host);
|
|
146
|
|
147 if(soapconn->login_path)
|
|
148 g_free(soapconn->login_path);
|
19784
|
149
|
|
150 /*remove the write handler*/
|
|
151 if (soapconn->output_handler > 0){
|
|
152 gaim_input_remove(soapconn->output_handler);
|
|
153 }
|
|
154 /*remove the read handler*/
|
|
155 if (soapconn->input_handler > 0){
|
|
156 gaim_input_remove(soapconn->input_handler);
|
|
157 }
|
|
158 msn_soap_free_read_buf(soapconn);
|
|
159 msn_soap_free_write_buf(soapconn);
|
|
160
|
|
161 /*close ssl connection*/
|
19804
|
162 msn_soap_close(soapconn);
|
|
163
|
19806
|
164 /*process the unhandled soap request*/
|
19804
|
165 while ((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){
|
|
166 msn_soap_request_free(request);
|
19788
|
167 }
|
19804
|
168 g_queue_free(soapconn->soap_queue);
|
19784
|
169 g_free(soapconn);
|
|
170 }
|
|
171
|
19785
|
172 /*check the soap is connected?
|
19806
|
173 * if connected return 1
|
19785
|
174 */
|
|
175 int
|
|
176 msn_soap_connected(MsnSoapConn *soapconn)
|
|
177 {
|
|
178 if(soapconn->ssl_conn){
|
19806
|
179 return (soapconn->gsc == NULL? 0 : 1);
|
19785
|
180 }
|
19806
|
181 return(soapconn->fd>0? 1 : 0);
|
19785
|
182 }
|
|
183
|
19784
|
184 /*read and append the content to the buffer*/
|
|
185 static gssize
|
|
186 msn_soap_read(MsnSoapConn *soapconn)
|
|
187 {
|
|
188 gssize len;
|
|
189 gssize total_len = 0;
|
19796
|
190 char temp_buf[MSN_SOAP_READ_BUFF_SIZE];
|
19784
|
191
|
|
192 if(soapconn->ssl_conn){
|
19796
|
193 len = gaim_ssl_read(soapconn->gsc, temp_buf,MSN_SOAP_READ_BUFF_SIZE);
|
19784
|
194 }else{
|
19796
|
195 len = read(soapconn->fd, temp_buf,MSN_SOAP_READ_BUFF_SIZE);
|
19784
|
196 }
|
|
197 if(len >0){
|
|
198 total_len += len;
|
|
199 soapconn->read_buf = g_realloc(soapconn->read_buf,
|
|
200 soapconn->read_len + len + 1);
|
|
201 // strncpy(soapconn->read_buf + soapconn->read_len, temp_buf, len);
|
|
202 memcpy(soapconn->read_buf + soapconn->read_len, temp_buf, len);
|
|
203 soapconn->read_len += len;
|
|
204 soapconn->read_buf[soapconn->read_len] = '\0';
|
|
205 }
|
19796
|
206 gaim_debug_info("MaYuan","++soap ssl read:{%d}\n",total_len);
|
19784
|
207 // gaim_debug_info("MaYuan","nexus ssl read:{%s}\n",soapconn->read_buf);
|
|
208 return total_len;
|
|
209 }
|
|
210
|
|
211 /*read the whole SOAP server response*/
|
|
212 void
|
|
213 msn_soap_read_cb(gpointer data, gint source, GaimInputCondition cond)
|
|
214 {
|
|
215 MsnSoapConn *soapconn = data;
|
|
216 MsnSession *session;
|
|
217 int len;
|
|
218 char * body_start,*body_len;
|
|
219 char *length_start,*length_end;
|
|
220
|
19785
|
221 // gaim_debug_misc("MaYuan", "soap read cb\n");
|
19784
|
222 session = soapconn->session;
|
|
223 g_return_if_fail(session != NULL);
|
|
224
|
|
225 if (soapconn->input_handler == -1){
|
|
226 soapconn->input_handler = gaim_input_add(soapconn->gsc->fd,
|
|
227 GAIM_INPUT_READ, msn_soap_read_cb, soapconn);
|
|
228 }
|
|
229
|
|
230 /*read the request header*/
|
|
231 len = msn_soap_read(soapconn);
|
|
232 if (len < 0 && errno == EAGAIN){
|
|
233 return;
|
|
234 }else if (len < 0) {
|
|
235 gaim_debug_error("msn", "read Error!len:%d\n",len);
|
|
236 gaim_input_remove(soapconn->input_handler);
|
|
237 soapconn->input_handler = -1;
|
|
238 g_free(soapconn->read_buf);
|
|
239 soapconn->read_buf = NULL;
|
|
240 soapconn->read_len = 0;
|
|
241 /* TODO: error handling */
|
|
242 return;
|
|
243 }
|
|
244
|
|
245 if(soapconn->read_buf == NULL){
|
|
246 return;
|
|
247 }
|
|
248
|
19788
|
249 if (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL)
|
|
250 {
|
|
251 /* Redirect. */
|
|
252 char *location, *c;
|
|
253
|
19796
|
254 gaim_debug_error("MaYuan", "soap redirect\n");
|
19788
|
255 location = strstr(soapconn->read_buf, "Location: ");
|
|
256 if (location == NULL)
|
|
257 {
|
|
258 msn_soap_free_read_buf(soapconn);
|
|
259
|
|
260 return;
|
|
261 }
|
|
262 location = strchr(location, ' ') + 1;
|
|
263
|
|
264 if ((c = strchr(location, '\r')) != NULL)
|
|
265 *c = '\0';
|
|
266
|
|
267 /* Skip the http:// */
|
|
268 if ((c = strchr(location, '/')) != NULL)
|
|
269 location = c + 2;
|
|
270
|
|
271 if ((c = strchr(location, '/')) != NULL)
|
|
272 {
|
|
273 g_free(soapconn->login_path);
|
|
274 soapconn->login_path = g_strdup(c);
|
|
275
|
|
276 *c = '\0';
|
|
277 }
|
|
278
|
|
279 g_free(soapconn->login_host);
|
|
280 soapconn->login_host = g_strdup(location);
|
|
281
|
|
282 gaim_ssl_connect(session->account, soapconn->login_host,
|
|
283 GAIM_SSL_DEFAULT_PORT, msn_soap_connect_cb,
|
|
284 msn_soap_error_cb, soapconn);
|
19784
|
285 }
|
19788
|
286 else if (strstr(soapconn->read_buf, "HTTP/1.1 401 Unauthorized") != NULL)
|
|
287 {
|
|
288 const char *error;
|
19784
|
289
|
19796
|
290 gaim_debug_error("MaYuan", "soap 401\n");
|
19788
|
291 if ((error = strstr(soapconn->read_buf, "WWW-Authenticate")) != NULL)
|
|
292 {
|
|
293 if ((error = strstr(error, "cbtxt=")) != NULL)
|
|
294 {
|
|
295 const char *c;
|
|
296 char *temp;
|
|
297
|
|
298 error += strlen("cbtxt=");
|
|
299
|
|
300 if ((c = strchr(error, '\n')) == NULL)
|
|
301 c = error + strlen(error);
|
|
302
|
|
303 temp = g_strndup(error, c - error);
|
|
304 error = gaim_url_decode(temp);
|
|
305 g_free(temp);
|
|
306 }
|
|
307 }
|
19784
|
308
|
19788
|
309 msn_session_set_error(session, MSN_ERROR_SERV_UNAVAILABLE, error);
|
|
310 }
|
|
311 else if (strstr(soapconn->read_buf, "HTTP/1.1 200 OK"))
|
|
312 {
|
|
313 /*OK! process the SOAP body*/
|
|
314 body_start = (char *)g_strstr_len(soapconn->read_buf, soapconn->read_len,"\r\n\r\n");
|
|
315 if(!body_start){
|
|
316 return;
|
|
317 }
|
|
318 body_start += 4;
|
|
319
|
|
320 // gaim_debug_misc("msn", "Soap Read: {%s}\n", soapconn->read_buf);
|
19784
|
321
|
19788
|
322 /* we read the content-length*/
|
|
323 length_start = strstr(soapconn->read_buf, "Content-Length: ");
|
|
324 length_start += strlen("Content-Length: ");
|
|
325 length_end = strstr(length_start, "\r\n");
|
|
326 body_len = g_strndup(length_start,length_end - length_start);
|
19784
|
327
|
19788
|
328 /*setup the conn body */
|
|
329 soapconn->body = body_start;
|
|
330 soapconn->body_len = atoi(body_len);
|
19796
|
331 gaim_debug_misc("MaYuan","SOAP Read length :%d,body len:%d\n",soapconn->read_len,soapconn->body_len);
|
19788
|
332
|
19796
|
333 if(soapconn->read_len < body_start - soapconn->read_buf + soapconn->body_len){
|
19804
|
334 return;
|
19788
|
335 }
|
|
336 g_free(body_len);
|
19784
|
337
|
19785
|
338 #if 1
|
19788
|
339 /*remove the read handler*/
|
|
340 gaim_input_remove(soapconn->input_handler);
|
|
341 soapconn->input_handler = -1;
|
19785
|
342 #endif
|
|
343
|
19788
|
344 /*call the read callback*/
|
|
345 if(soapconn->read_cb != NULL){
|
19804
|
346 soapconn->read_cb(soapconn,source,0);
|
19788
|
347 }
|
19808
|
348 /*clear the read buffer*/
|
|
349 msn_soap_free_read_buf(soapconn);
|
19804
|
350
|
|
351 /*Process the next queued SOAP request*/
|
|
352 msn_soap_post_head_request(soapconn);
|
|
353
|
19784
|
354 #if 0
|
|
355 /*remove the read handler*/
|
|
356 gaim_input_remove(soapconn->input_handler);
|
|
357 soapconn->input_handler = -1;
|
19788
|
358 // gaim_ssl_close(soapconn->gsc);
|
|
359 // soapconn->gsc = NULL;
|
19784
|
360 #endif
|
19788
|
361 }
|
19796
|
362 return;
|
19784
|
363 }
|
|
364
|
|
365 void
|
|
366 msn_soap_free_read_buf(MsnSoapConn *soapconn)
|
|
367 {
|
|
368 if(soapconn->read_buf){
|
|
369 g_free(soapconn->read_buf);
|
|
370 }
|
|
371 soapconn->read_buf = NULL;
|
|
372 soapconn->read_len = 0;
|
|
373 }
|
|
374
|
|
375 void
|
|
376 msn_soap_free_write_buf(MsnSoapConn *soapconn)
|
|
377 {
|
|
378 if(soapconn->write_buf){
|
|
379 g_free(soapconn->write_buf);
|
|
380 }
|
|
381 soapconn->write_buf = NULL;
|
|
382 soapconn->written_len = 0;
|
|
383 }
|
|
384
|
|
385 /*Soap write process func*/
|
|
386 static void
|
|
387 msn_soap_write_cb(gpointer data, gint source, GaimInputCondition cond)
|
|
388 {
|
|
389 MsnSoapConn *soapconn = data;
|
|
390 int len, total_len;
|
|
391
|
19796
|
392 g_return_if_fail(soapconn != NULL);
|
|
393 if(soapconn->write_buf == NULL){
|
|
394 gaim_debug_error("MaYuan","soap buffer is NULL\n");
|
|
395 gaim_input_remove(soapconn->output_handler);
|
|
396 soapconn->output_handler = -1;
|
|
397 return;
|
|
398 }
|
19784
|
399 total_len = strlen(soapconn->write_buf);
|
|
400
|
|
401 /*
|
|
402 * write the content to SSL server,
|
|
403 */
|
|
404 len = gaim_ssl_write(soapconn->gsc,
|
|
405 soapconn->write_buf + soapconn->written_len,
|
|
406 total_len - soapconn->written_len);
|
|
407
|
|
408 if (len < 0 && errno == EAGAIN)
|
|
409 return;
|
|
410 else if (len <= 0){
|
|
411 /*SSL write error!*/
|
|
412 gaim_input_remove(soapconn->output_handler);
|
|
413 soapconn->output_handler = -1;
|
|
414 /* TODO: notify of the error */
|
|
415 return;
|
|
416 }
|
|
417 soapconn->written_len += len;
|
|
418
|
|
419 if (soapconn->written_len < total_len)
|
|
420 return;
|
|
421
|
|
422 gaim_input_remove(soapconn->output_handler);
|
|
423 soapconn->output_handler = -1;
|
|
424
|
|
425 /*clear the write buff*/
|
|
426 msn_soap_free_write_buf(soapconn);
|
|
427
|
|
428 /* Write finish!
|
|
429 * callback for write done
|
|
430 */
|
|
431 if(soapconn->written_cb != NULL){
|
|
432 soapconn->written_cb(soapconn, source, 0);
|
|
433 }
|
|
434 }
|
|
435
|
|
436 /*write the buffer to SOAP connection*/
|
|
437 void
|
|
438 msn_soap_write(MsnSoapConn * soapconn, char *write_buf, GaimInputFunction written_cb)
|
|
439 {
|
|
440 soapconn->write_buf = write_buf;
|
|
441 soapconn->written_len = 0;
|
|
442 soapconn->written_cb = written_cb;
|
19785
|
443
|
|
444 /*clear the read buffer first*/
|
19784
|
445 /*start the write*/
|
|
446 soapconn->output_handler = gaim_input_add(soapconn->gsc->fd, GAIM_INPUT_WRITE,
|
|
447 msn_soap_write_cb, soapconn);
|
|
448 msn_soap_write_cb(soapconn, soapconn->gsc->fd, GAIM_INPUT_WRITE);
|
|
449 }
|
|
450
|
19804
|
451 /* New a soap request*/
|
|
452 MsnSoapReq *
|
|
453 msn_soap_request_new(const char *host,const char *post_url,const char *soap_action,
|
|
454 const char *body,
|
|
455 GaimInputFunction read_cb,GaimInputFunction written_cb)
|
|
456 {
|
|
457 MsnSoapReq *request;
|
|
458
|
|
459 request = g_new0(MsnSoapReq, 1);
|
|
460 request->id = 0;
|
|
461
|
|
462 request->login_host = g_strdup(host);
|
|
463 request->login_path = g_strdup(post_url);
|
|
464 request->soap_action = g_strdup(soap_action);
|
|
465 request->body = g_strdup(body);
|
|
466 request->read_cb = read_cb;
|
|
467 request->written_cb = written_cb;
|
|
468
|
|
469 return request;
|
|
470 }
|
|
471
|
|
472 /*free a soap request*/
|
19785
|
473 void
|
19804
|
474 msn_soap_request_free(MsnSoapReq *request)
|
|
475 {
|
|
476 g_return_if_fail(request != NULL);
|
|
477
|
|
478 g_free(request->login_host);
|
|
479 g_free(request->login_path);
|
|
480 g_free(request->soap_action);
|
|
481 g_free(request->body);
|
|
482 request->read_cb = NULL;
|
|
483 request->written_cb = NULL;
|
|
484
|
|
485 g_free(request);
|
|
486 }
|
|
487
|
19807
|
488 /*post the soap request queue's head request*/
|
19804
|
489 void
|
|
490 msn_soap_post_head_request(MsnSoapConn *soapconn)
|
|
491 {
|
|
492 if(!g_queue_is_empty(soapconn->soap_queue)){
|
|
493 MsnSoapReq *request;
|
|
494 if((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){
|
|
495 msn_soap_post_request(soapconn,request);
|
|
496 }
|
|
497 }
|
19806
|
498 msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED_IDLE);
|
19804
|
499 }
|
|
500
|
19807
|
501 /*post the soap request ,
|
|
502 * if not connected, Connected first.
|
|
503 */
|
19804
|
504 void
|
19806
|
505 msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request,
|
|
506 MsnSoapConnectInitFunction msn_soap_init_func)
|
19804
|
507 {
|
|
508 g_queue_push_tail(soapconn->soap_queue, request);
|
|
509 if(!msn_soap_connected(soapconn)){
|
|
510 /*not connected?connect it first*/
|
19806
|
511 gaim_debug_info("Ma Yuan","soap is not connected!\n");
|
|
512 msn_soap_init_func(soapconn);
|
19804
|
513 msn_soap_connect(soapconn);
|
|
514 return;
|
|
515 }
|
19806
|
516 gaim_debug_info("Ma Yuan","soap connected!\n");
|
19804
|
517 /*if connected, what we only needed to do is to queue the request,
|
|
518 * when SOAP request in the queue processed done, will do this command.
|
|
519 * we just waiting...
|
|
520 */
|
19806
|
521 if(soapconn->step == MSN_SOAP_CONNECTED_IDLE){
|
|
522 msn_soap_post_head_request(soapconn);
|
|
523 }
|
19804
|
524 }
|
|
525
|
|
526 /*Post the soap request action*/
|
|
527 void
|
|
528 msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request)
|
19785
|
529 {
|
|
530 char * soap_head = NULL;
|
|
531 char * request_str = NULL;
|
|
532
|
19790
|
533 gaim_debug_info("MaYuan","msn_soap_post()...\n");
|
19806
|
534 msn_soap_set_process_step(soapconn,MSN_SOAP_PROCESSING);
|
19785
|
535 soap_head = g_strdup_printf(
|
|
536 "POST %s HTTP/1.1\r\n"
|
|
537 "SOAPAction: %s\r\n"
|
|
538 "Content-Type:text/xml; charset=utf-8\r\n"
|
|
539 "Cookie: MSPAuth=%s\r\n"
|
|
540 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n"
|
|
541 "Accept: text/*\r\n"
|
|
542 "Host: %s\r\n"
|
|
543 "Content-Length: %d\r\n"
|
|
544 "Connection: Keep-Alive\r\n"
|
|
545 "Cache-Control: no-cache\r\n\r\n",
|
19804
|
546 request->login_path,
|
|
547 request->soap_action,
|
19785
|
548 soapconn->session->passport_info.mspauth,
|
19804
|
549 request->login_host,
|
|
550 strlen(request->body)
|
19785
|
551 );
|
19804
|
552 request_str = g_strdup_printf("%s%s", soap_head,request->body);
|
19785
|
553 g_free(soap_head);
|
|
554
|
|
555 /*free read buffer*/
|
|
556 msn_soap_free_read_buf(soapconn);
|
19788
|
557 gaim_debug_info("MaYuan","send to server{%s}\n",request_str);
|
19804
|
558 msn_soap_write(soapconn,request_str,request->written_cb);
|
19785
|
559 }
|
|
560
|