cpw.malu.xmpp.jingle_ft: 6f07196b: Keep track of when the other end sends a...

malu at pidgin.im malu at pidgin.im
Mon May 4 14:40:26 EDT 2009


-----------------------------------------------------------------
Revision: 6f07196b09d67e610cc854e133cf8191429863b4
Ancestor: 700c17a19c46f73e12033adc5aeea9df11c17d36
Author: malu at pidgin.im
Date: 2009-05-04T18:36:56
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/6f07196b09d67e610cc854e133cf8191429863b4

Modified files:
        libpurple/protocols/jabber/jingle/file-transfer.c

ChangeLog: 

Keep track of when the other end sends a streamhost error in the content
handler

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	7e67641d27bf17d256e617a86f83b48609a93b30
+++ libpurple/protocols/jabber/jingle/file-transfer.c	964981162598f0a4decdad0282e1f98829ea9baf
@@ -29,6 +29,7 @@ struct _JingleFTPrivate {
 struct _JingleFTPrivate {
 	PurpleXfer *xfer;
 	FILE *ibb_fp; /* used to read/write from/to IBB streams */
+	gboolean remote_failed_s5b;
 };
 
 #define JINGLE_FT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
@@ -741,9 +742,21 @@ jingle_file_transfer_handle_action_inter
 			JingleSession *session = jingle_content_get_session(content);
 			JingleTransport *transport = jingle_transport_parse(
 					xmlnode_get_child(xmlcontent, "transport"));
+			xmlnode *xmltransport = xmlnode_get_child(xmlcontent, "transport");
 			
 			/* we should check for "stream-host" error (in the case of S5B) and
 			 offer a transport-replace with IBB */
+			if (xmltransport) {
+				xmlnode *streamhost_error = 
+					xmlnode_get_child(xmltransport, "streamhost-error");
+
+				if (streamhost_error) {
+					purple_debug_info("jingle-ft", 
+						"got a streamhost-error, remote couldn't connect\n");
+					JINGLE_FT_GET_PRIVATE(JINGLE_FT(content))->
+						remote_failed_s5b = TRUE;
+				}
+			}
 			
 			g_object_unref(session);
 			break;


More information about the Commits mailing list