Merged in default (pull request #628)

Wed, 06 Nov 2019 04:54:32 +0000

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 06 Nov 2019 04:54:32 +0000
changeset 40158
360997c25b1a
parent 40150
eda298799a8e (current diff)
parent 40157
e74e34093dfa (diff)
child 40159
1e72d4cc60ad
child 40163
08952f115a7c
child 40165
6bb197792c6d
child 40168
036de5bdb8da
child 40170
c69c52a5ffe7

Merged in default (pull request #628)

Decrease Delay for XMPP File Transfers Using Streamhosts

Approved-by: Gary Kramlich

libpurple/protocols/jabber/si.c file | annotate | diff | comparison | revisions
--- a/COPYRIGHT	Tue Nov 05 21:07:41 2019 -0500
+++ b/COPYRIGHT	Wed Nov 06 04:54:32 2019 +0000
@@ -387,6 +387,7 @@
 Tim Mooney
 Sergio Moretto
 Nader Morshed
+Evert Mouw
 Keith Moyer
 Andrei Mozzhuhin
 Christian Muise
--- a/libpurple/protocols/jabber/si.c	Tue Nov 05 21:07:41 2019 -0500
+++ b/libpurple/protocols/jabber/si.c	Wed Nov 06 04:54:32 2019 +0000
@@ -39,7 +39,7 @@
 #include "iq.h"
 #include "si.h"
 
-#define STREAMHOST_CONNECT_TIMEOUT 15
+#define STREAMHOST_CONNECT_TIMEOUT 5
 #define ENABLE_FT_THUMBNAILS 0
 
 struct _JabberSIXfer {
@@ -358,13 +358,17 @@
 				((host = purple_xmlnode_get_attrib(streamhost, "host")) &&
 				(port = purple_xmlnode_get_attrib(streamhost, "port")) &&
 				(portnum = atoi(port))))) {
-			JabberBytestreamsStreamhost *sh = g_new0(JabberBytestreamsStreamhost, 1);
-			sh->jid = g_strdup(jid);
-			sh->host = g_strdup(host);
-			sh->port = portnum;
-			sh->zeroconf = g_strdup(zeroconf);
-			/* If there were a lot of these, it'd be worthwhile to prepend and reverse. */
-			jsx->streamhosts = g_list_append(jsx->streamhosts, sh);
+			/* ignore 0.0.0.0 */
+			if(purple_strequal(host, "0.0.0.0") == FALSE) {
+				JabberBytestreamsStreamhost *sh = g_new0(JabberBytestreamsStreamhost, 1);
+				sh->jid = g_strdup(jid);
+				sh->host = g_strdup(host);
+				sh->port = portnum;
+				sh->zeroconf = g_strdup(zeroconf);
+
+				/* If there were a lot of these, it'd be worthwhile to prepend and reverse. */
+				jsx->streamhosts = g_list_append(jsx->streamhosts, sh);
+			}
 		}
 	}
 

mercurial