| 77 { |
78 { |
| 78 MsnSoapConnection *conn = g_new0(MsnSoapConnection, 1); |
79 MsnSoapConnection *conn = g_new0(MsnSoapConnection, 1); |
| 79 conn->session = session; |
80 conn->session = session; |
| 80 conn->host = g_strdup(host); |
81 conn->host = g_strdup(host); |
| 81 conn->queue = g_queue_new(); |
82 conn->queue = g_queue_new(); |
| |
83 conn->unsafe_debug = g_getenv("PURPLE_MSN_UNSAFE_DEBUG") != NULL; |
| 82 return conn; |
84 return conn; |
| 83 } |
85 } |
| 84 |
86 |
| 85 static void |
87 static void |
| 86 msn_soap_message_destroy(MsnSoapMessage *message) |
88 msn_soap_message_destroy(MsnSoapMessage *message) |
| 502 |
504 |
| 503 perrno = errno; |
505 perrno = errno; |
| 504 if (cnt < 0 && perrno != EAGAIN) |
506 if (cnt < 0 && perrno != EAGAIN) |
| 505 purple_debug_info("soap", "read: %s\n", g_strerror(perrno)); |
507 purple_debug_info("soap", "read: %s\n", g_strerror(perrno)); |
| 506 |
508 |
| 507 #ifndef MSN_UNSAFE_DEBUG |
509 if (conn->current_request && conn->current_request->secure && |
| 508 if (conn->current_request && conn->current_request->secure) |
510 !conn->unsafe_debug) |
| 509 purple_debug_misc("soap", "Received secure request.\n"); |
511 purple_debug_misc("soap", "Received secure request.\n"); |
| 510 else |
512 else if (count != 0) |
| 511 #endif |
|
| 512 if (count != 0) |
|
| 513 purple_debug_misc("soap", "current %s\n", conn->buf->str + cursor); |
513 purple_debug_misc("soap", "current %s\n", conn->buf->str + cursor); |
| 514 |
514 |
| 515 /* && count is necessary for Adium, on OS X the last read always |
515 /* && count is necessary for Adium, on OS X the last read always |
| 516 return an error, so we want to proceed anyway. See #5212 for |
516 return an error, so we want to proceed anyway. See #5212 for |
| 517 discussion on this and the above buffer size issues */ |
517 discussion on this and the above buffer size issues */ |
| 655 } |
655 } |
| 656 |
656 |
| 657 g_string_append(conn->buf, "\r\n"); |
657 g_string_append(conn->buf, "\r\n"); |
| 658 g_string_append(conn->buf, body); |
658 g_string_append(conn->buf, body); |
| 659 |
659 |
| 660 #ifndef MSN_UNSAFE_DEBUG |
660 if (req->secure && !conn->unsafe_debug) |
| 661 if (req->secure) |
|
| 662 purple_debug_misc("soap", "Sending secure request.\n"); |
661 purple_debug_misc("soap", "Sending secure request.\n"); |
| 663 else |
662 else |
| 664 #endif |
663 purple_debug_misc("soap", "%s\n", conn->buf->str); |
| 665 purple_debug_misc("soap", "%s\n", conn->buf->str); |
|
| 666 |
664 |
| 667 conn->handled_len = 0; |
665 conn->handled_len = 0; |
| 668 conn->current_request = req; |
666 conn->current_request = req; |
| 669 |
667 |
| 670 conn->event_handle = purple_input_add(conn->ssl->fd, |
668 conn->event_handle = purple_input_add(conn->ssl->fd, |