# HG changeset patch # User Marcus Lundblad # Date 1222544380 0 # Node ID cd4a5275ba062b84f3863c91d8eaed2ec2bc3e0b # Parent be762644486f2adfe378c7f80f30c0ad2177626c# Parent e414fb3c8c70e7007de94b07862460d4c165eedd merge of '421269ebbe32a67020772ec7ba39a1e5f8b14b4c' and 'e93b917159d299a748daabcb28522fd911304d55' diff -r e414fb3c8c70 -r cd4a5275ba06 libpurple/protocols/jabber/ibb.c --- a/libpurple/protocols/jabber/ibb.c Thu Sep 25 17:29:20 2008 +0000 +++ b/libpurple/protocols/jabber/ibb.c Sat Sep 27 19:39:40 2008 +0000 @@ -328,6 +328,9 @@ { JabberIBBSessionState state = jabber_ibb_session_get_state(sess); + purple_debug_info("jabber", "sending data block of %d bytes on IBB stream\n", + size); + if (state != JABBER_IBB_SESSION_OPENED) { purple_debug_error("jabber", "trying to send data on a non-open IBB session\n"); @@ -408,10 +411,14 @@ g_free(base64); if (rawdata) { + purple_debug_info("jabber", + "got %d bytes of data on IBB stream\n", size); if (size > jabber_ibb_session_get_block_size(sess)) { purple_debug_error("jabber", "IBB: received a too large packet\n"); } else { + purple_debug_info("jabber", + "calling IBB callback for received data\n"); sess->data_received_cb(sess, rawdata, size); } g_free(rawdata); diff -r e414fb3c8c70 -r cd4a5275ba06 libpurple/protocols/jabber/si.c --- a/libpurple/protocols/jabber/si.c Thu Sep 25 17:29:20 2008 +0000 +++ b/libpurple/protocols/jabber/si.c Sat Sep 27 19:39:40 2008 +0000 @@ -959,6 +959,7 @@ purple_xfer_end(xfer); } else { purple_xfer_set_completed(xfer, TRUE); + jabber_si_xfer_free(xfer); } } @@ -970,6 +971,7 @@ JabberSIXfer *jsx = (JabberSIXfer *) xfer->data; if (size <= purple_xfer_get_bytes_remaining(xfer)) { + purple_debug_info("jabber", "about to write %d bytes from IBB stream\n"); fwrite(data, size, 1, jsx->fp); purple_xfer_set_bytes_sent(xfer, purple_xfer_get_bytes_sent(xfer) + size); purple_xfer_update_progress(xfer); @@ -1008,7 +1010,7 @@ jabber_si_xfer_ibb_error_cb); /* open the file to write to */ - jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "w"); + jsx->fp = fopen(purple_xfer_get_local_filename(xfer), "w"); jsx->ibb_session = sess; @@ -1060,6 +1062,7 @@ /* close the session */ jabber_ibb_session_close(sess); purple_xfer_set_completed(xfer, TRUE); + jabber_si_xfer_free(xfer); } else { /* send more... */ jabber_si_xfer_ibb_send_data(sess); @@ -1075,7 +1078,7 @@ purple_xfer_start(xfer, 0, NULL, 0); purple_xfer_set_bytes_sent(xfer, 0); purple_xfer_update_progress(xfer); - jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "r"); + jsx->fp = fopen(purple_xfer_get_local_filename(xfer), "r"); jabber_si_xfer_ibb_send_data(sess); } @@ -1255,7 +1258,7 @@ g_free(jsx); xfer->data = NULL; - purple_debug_info("jabber", "jabber_si_xfer_free(): freeing jsx %p", jsx); + purple_debug_info("jabber", "jabber_si_xfer_free(): freeing jsx %p\n", jsx); } static void jabber_si_xfer_cancel_send(PurpleXfer *xfer)