cpw.malu.xmpp.jingle_ft: f86aa5e5: Disregard IBB data for file transfers th...
malu at pidgin.im
malu at pidgin.im
Mon Jan 18 17:11:15 EST 2010
-----------------------------------------------------------------
Revision: f86aa5e546a66e360aa9c1a56009f3d0ad0ac962
Ancestor: 43588c0e327fd7422dc526a6a958be2091741a91
Author: malu at pidgin.im
Date: 2010-01-18T22:06:06
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/f86aa5e546a66e360aa9c1a56009f3d0ad0ac962
Modified files:
libpurple/protocols/jabber/jingle/file-transfer.c
ChangeLog:
Disregard IBB data for file transfers that is not started (i.e. cancelled), this allows the
session-terminate callback to do its thing, destroying the session
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c eb2bc196b508e8f0a2652529e870ecdbba58b0ef
+++ libpurple/protocols/jabber/jingle/file-transfer.c e45a8dc794b994b4c5aa5045b71f9ccab2754450
@@ -232,17 +232,19 @@ jingle_file_transfer_ibb_data_recv_callb
JingleFT *ft = JINGLE_FT(content);
PurpleXfer *xfer = JINGLE_FT_GET_PRIVATE(ft)->xfer;
- if (size <= purple_xfer_get_bytes_remaining(xfer)) {
- purple_debug_info("jingle-ft",
- "about to write %" G_GSIZE_FORMAT " bytes from IBB stream\n",
- size);
- purple_circ_buffer_append(ft->priv->ibb_buffer, data, size);
- purple_xfer_prpl_ready(xfer);
- } else {
- /* sending more than intended */
- purple_debug_error("jingle-ft",
- "IBB file transfer send more data than expected\n");
- jingle_file_transfer_cancel_remote(content);
+ if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_STARTED) {
+ if (size <= purple_xfer_get_bytes_remaining(xfer)) {
+ purple_debug_info("jingle-ft",
+ "about to write %" G_GSIZE_FORMAT " bytes from IBB stream\n",
+ size);
+ purple_circ_buffer_append(ft->priv->ibb_buffer, data, size);
+ purple_xfer_prpl_ready(xfer);
+ } else {
+ /* sending more than intended */
+ purple_debug_error("jingle-ft",
+ "IBB file transfer send more data than expected\n");
+ jingle_file_transfer_cancel_remote(content);
+ }
}
}
More information about the Commits
mailing list