Mercurial > pidgin
comparison src/protocols/msn/switchboard.c @ 6827:1cfbb731aa1f
[gaim-migrate @ 7372]
Several fixes for attempted NULL pointer frees, and some MSNSLP fixes.
Still not ready for use yet.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 14 Sep 2003 01:59:09 +0000 |
parents | 2adf21e70601 |
children | a372cf34387e |
comparison
equal
deleted
inserted
replaced
6826:2adf21e70601 | 6827:1cfbb731aa1f |
---|---|
43 msn_message_set_content_type(msg, "text/x-clientcaps"); | 43 msn_message_set_content_type(msg, "text/x-clientcaps"); |
44 msn_message_set_charset(msg, NULL); | 44 msn_message_set_charset(msg, NULL); |
45 msn_message_set_attr(msg, "User-Agent", NULL); | 45 msn_message_set_attr(msg, "User-Agent", NULL); |
46 msn_message_set_body(msg, MSN_CLIENTINFO); | 46 msn_message_set_body(msg, MSN_CLIENTINFO); |
47 | 47 |
48 if (!msn_switchboard_send_msg(swboard, msg)) { | 48 if (!msn_switchboard_send_msg(swboard, msg)) |
49 { | |
49 gaim_debug_warning("msn", | 50 gaim_debug_warning("msn", |
50 "Unable to send clientcaps. " | 51 "Unable to send clientcaps. " |
51 "Disconnecting from switchboard.\n"); | 52 "Disconnecting from switchboard.\n"); |
52 msn_switchboard_destroy(swboard); | 53 msn_switchboard_destroy(swboard); |
53 | 54 |
91 MsnSwitchBoard *swboard = servconn->data; | 92 MsnSwitchBoard *swboard = servconn->data; |
92 MsnSession *session = servconn->session; | 93 MsnSession *session = servconn->session; |
93 | 94 |
94 send_clientcaps(swboard); | 95 send_clientcaps(swboard); |
95 | 96 |
96 #if 0 | 97 if (0 && session->protocol_ver >= 9) |
97 if (session->protocol_ver >= 9) | |
98 { | 98 { |
99 MsnUser *local_user, *remote_user; | 99 MsnUser *local_user, *remote_user; |
100 | 100 |
101 remote_user = msn_user_new(session, | 101 remote_user = msn_user_new(session, |
102 msn_user_get_passport(msn_switchboard_get_user(swboard)), | 102 msn_user_get_passport(msn_switchboard_get_user(swboard)), |
109 | 109 |
110 msn_slp_session_request_user_display(swboard->slp_session, | 110 msn_slp_session_request_user_display(swboard->slp_session, |
111 local_user, remote_user, | 111 local_user, remote_user, |
112 msn_user_get_object(remote_user)); | 112 msn_user_get_object(remote_user)); |
113 } | 113 } |
114 #endif | |
115 | 114 |
116 return TRUE; | 115 return TRUE; |
117 } | 116 } |
118 | 117 |
119 static gboolean | 118 static gboolean |
637 msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg) | 636 msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg) |
638 { | 637 { |
639 char *buf; | 638 char *buf; |
640 size_t len; | 639 size_t len; |
641 int ret; | 640 int ret; |
641 FILE *fp; | |
642 | 642 |
643 g_return_val_if_fail(swboard != NULL, FALSE); | 643 g_return_val_if_fail(swboard != NULL, FALSE); |
644 g_return_val_if_fail(msg != NULL, FALSE); | 644 g_return_val_if_fail(msg != NULL, FALSE); |
645 | 645 |
646 msn_message_set_transaction_id(msg, ++swboard->trId); | 646 msn_message_set_transaction_id(msg, ++swboard->trId); |
656 | 656 |
657 return TRUE; | 657 return TRUE; |
658 } | 658 } |
659 | 659 |
660 ret = msn_servconn_write(swboard->servconn, buf, len); | 660 ret = msn_servconn_write(swboard->servconn, buf, len); |
661 | |
662 fp = fopen("/tmp/msn-msg", "wb"); | |
663 fwrite(buf, 1, len, fp); | |
664 fclose(fp); | |
661 | 665 |
662 g_free(buf); | 666 g_free(buf); |
663 | 667 |
664 return (ret > 0); | 668 return (ret > 0); |
665 } | 669 } |