cpw.malu.xmpp.jingle_ft: 22ca1a0c: Send a transport-reject when getting a t...
malu at pidgin.im
malu at pidgin.im
Thu May 14 15:10:30 EDT 2009
-----------------------------------------------------------------
Revision: 22ca1a0c23949bfd2b953affaa3ab85a94cafd5d
Ancestor: c315ffd639385e6b4500dc3b36800b0ceae5c692
Author: malu at pidgin.im
Date: 2009-05-14T19:06:47
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/22ca1a0c23949bfd2b953affaa3ab85a94cafd5d
Modified files:
libpurple/protocols/jabber/jingle/file-transfer.c
ChangeLog:
Send a transport-reject when getting a transport-replace with something
other than IBB.
Handle transport-reject, cancelling the transfer and terminating the session.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c 33fe921eed826ef2a8ceaa5e98111bb22d029139
+++ libpurple/protocols/jabber/jingle/file-transfer.c c500507795b36fb3d2827243dab4487935c32f9f
@@ -917,6 +917,10 @@ jingle_file_transfer_handle_action_inter
/* send transport-accept */
jabber_iq_send(jingle_session_to_packet(session,
JINGLE_TRANSPORT_ACCEPT));
+ } else {
+ /* we don't currently handle other fallback methods than IBB */
+ jabber_iq_send(jingle_session_to_packet(session,
+ JINGLE_TRANSPORT_REJECT));
}
g_object_unref(new_transport);
@@ -924,6 +928,27 @@ jingle_file_transfer_handle_action_inter
g_object_unref(session);
break;
}
+ case JINGLE_TRANSPORT_REJECT: {
+ JingleSession *session = jingle_content_get_session(content);
+ PurpleXfer *xfer =
+ jingle_file_transfer_get_xfer(content);
+
+ /* do stuff here... close transfer etc... */
+ if (xfer) {
+ purple_debug_info("jingle",
+ "got transport-reject, ending transfer %p with content %p\n",
+ xfer, xfer->data);
+ if (!purple_xfer_is_canceled(xfer))
+ purple_xfer_cancel_local(xfer);
+ JINGLE_FT_GET_PRIVATE(JINGLE_FT(content))->xfer = NULL;
+ xfer->data = NULL;
+ }
+
+ jabber_iq_send(jingle_session_to_packet(session,
+ JINGLE_SESSION_TERMINATE));
+ g_object_unref(session);
+ break;
+ }
default:
break;
}
More information about the Commits
mailing list