comparison libpurple/protocols/jabber/si.c @ 22656:919074aa02ca

I've seen intermittent crashes on xmpp file transfers in this code, but I haven't been able to figure out the source. This is some debug logging which will hopefully be illustrative next time someone reports the crash.
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 16 Apr 2008 00:01:03 +0000
parents 1a7b74a20bfe
children 9004da91edd3 1d012e75153f
comparison
equal deleted inserted replaced
22655:fa7e07c74a59 22656:919074aa02ca
662 return; 662 return;
663 663
664 if(!(jid = xmlnode_get_attrib(streamhost_used, "jid"))) 664 if(!(jid = xmlnode_get_attrib(streamhost_used, "jid")))
665 return; 665 return;
666 666
667 purple_debug_info("jabber", "jabber_si_connect_proxy_cb() will be looking at jsx %p: jsx->streamhosts is %p and jid is %p",
668 jsx, jsx->streamhosts, jid);
669
667 if(!(matched = g_list_find_custom(jsx->streamhosts, jid, jabber_si_compare_jid))) 670 if(!(matched = g_list_find_custom(jsx->streamhosts, jid, jabber_si_compare_jid)))
668 { 671 {
669 gchar *my_jid = g_strdup_printf("%s@%s/%s", jsx->js->user->node, 672 gchar *my_jid = g_strdup_printf("%s@%s/%s", jsx->js->user->node,
670 jsx->js->user->domain, jsx->js->user->resource); 673 jsx->js->user->domain, jsx->js->user->resource);
671 if (!strcmp(jid, my_jid)) 674 if (!strcmp(jid, my_jid))
778 } else 781 } else
779 portnum = 7777; 782 portnum = 7777;
780 783
781 g_snprintf(port, sizeof(port), "%hu", portnum); 784 g_snprintf(port, sizeof(port), "%hu", portnum);
782 785
786 purple_debug_info("jabber", "jabber_si_xfer_bytestreams_listen_cb() will be looking at jsx %p: jsx->streamhosts %p and ft_proxy_list[%i] %p",
787 jsx, jsx->streamhosts, i, ft_proxy_list[i]);
783 if(g_list_find_custom(jsx->streamhosts, ft_proxy_list[i], jabber_si_compare_jid) != NULL) 788 if(g_list_find_custom(jsx->streamhosts, ft_proxy_list[i], jabber_si_compare_jid) != NULL)
784 continue; 789 continue;
785 790
786 streamhost = xmlnode_new_child(query, "streamhost"); 791 streamhost = xmlnode_new_child(query, "streamhost");
787 xmlnode_set_attrib(streamhost, "jid", ft_proxy_list[i]); 792 xmlnode_set_attrib(streamhost, "jid", ft_proxy_list[i]);
805 /* TODO: deal with zeroconf proxies */ 810 /* TODO: deal with zeroconf proxies */
806 811
807 if (!(sh->jid && sh->host && sh->port > 0)) 812 if (!(sh->jid && sh->host && sh->port > 0))
808 continue; 813 continue;
809 814
815 purple_debug_info("jabber", "jabber_si_xfer_bytestreams_listen_cb() will be looking at jsx %p: jsx->streamhosts %p and sh->jid %p",
816 jsx, jsx->streamhosts, sh->jid);
810 if(g_list_find_custom(jsx->streamhosts, sh->jid, jabber_si_compare_jid) != NULL) 817 if(g_list_find_custom(jsx->streamhosts, sh->jid, jabber_si_compare_jid) != NULL)
811 continue; 818 continue;
812 819
813 streamhost = xmlnode_new_child(query, "streamhost"); 820 streamhost = xmlnode_new_child(query, "streamhost");
814 xmlnode_set_attrib(streamhost, "jid", sh->jid); 821 xmlnode_set_attrib(streamhost, "jid", sh->jid);
967 g_free(jsx->iq_id); 974 g_free(jsx->iq_id);
968 /* XXX: free other stuff */ 975 /* XXX: free other stuff */
969 g_free(jsx->rxqueue); 976 g_free(jsx->rxqueue);
970 g_free(jsx); 977 g_free(jsx);
971 xfer->data = NULL; 978 xfer->data = NULL;
979
980 purple_debug_info("jabber", "jabber_si_xfer_free(): freeing jsx %p", jsx);
972 } 981 }
973 982
974 static void jabber_si_xfer_cancel_send(PurpleXfer *xfer) 983 static void jabber_si_xfer_cancel_send(PurpleXfer *xfer)
975 { 984 {
976 jabber_si_xfer_free(xfer); 985 jabber_si_xfer_free(xfer);