pidgin/pidgin

771af5c28038
Parents 6378938ad9c5
Children 21c032e12ec4
Less delay for XMPP file transfer using streamhosts. Ignore 0.0.0.0.
--- a/libpurple/protocols/jabber/si.c Wed Oct 09 23:36:43 2019 -0500
+++ b/libpurple/protocols/jabber/si.c Tue Nov 05 21:01:38 2019 -0500
@@ -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
typedef struct _JabberSIXfer {
@@ -356,13 +356,17 @@
((host = xmlnode_get_attrib(streamhost, "host")) &&
(port = 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") != 0) {
+ 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);
+ }
}
}