summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2017-11-25 20:21:16 +0000
committerGary Kramlich <grim@reaperworld.com>2017-11-25 20:21:16 +0000
commitfc5195151476fd7f43423ee20307b0956efc6d47 (patch)
tree465cb0b4f35c7d18b9c22cf2e06d852a7e425a14
parenta206127e81f95d301d0352b8e5a9bf45ee320cdc (diff)
parent285ad59ba1df31ab84e90b6002a114c023ab64a8 (diff)
downloadpidgin-fc5195151476fd7f43423ee20307b0956efc6d47.tar.gz
Merged in yazawanico/main/bosh-pipeline (pull request #295)
bosh.c: remove HTTP Pipelining, fix #17025 Approved-by: Eion Robb <eionrobb@gmail.com> Approved-by: Gary Kramlich <grim@reaperworld.com>
-rw-r--r--libpurple/protocols/jabber/bosh.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/libpurple/protocols/jabber/bosh.c b/libpurple/protocols/jabber/bosh.c
index af178c64bc..d80ecd6ac1 100644
--- a/libpurple/protocols/jabber/bosh.c
+++ b/libpurple/protocols/jabber/bosh.c
@@ -68,7 +68,6 @@ struct _PurpleBOSHConnection {
char *path;
guint16 port;
- gboolean pipelining;
gboolean ssl;
enum {
@@ -212,7 +211,6 @@ jabber_bosh_connection_init(JabberStream *js, const char *url)
conn->port = port;
conn->path = g_strdup_printf("/%s", path);
g_free(path);
- conn->pipelining = TRUE;
if (purple_ip_address_is_valid(host))
js->serverFQDN = g_strdup(js->user->domain);
@@ -285,12 +283,6 @@ find_available_http_connection(PurpleBOSHConnection *conn)
if (purple_debug_is_verbose())
debug_dump_http_connections(conn);
- /* Easy solution: Does everyone involved support pipelining? Hooray! Just use
- * one TCP connection! */
- if (conn->pipelining)
- return conn->connections[0]->state == HTTP_CONN_CONNECTED ?
- conn->connections[0] : NULL;
-
/* First loop, look for a connection that's ready */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
@@ -465,27 +457,6 @@ jabber_bosh_connection_send_keepalive(PurpleBOSHConnection *bosh)
send_timer_cb(bosh);
}
-static void
-jabber_bosh_disable_pipelining(PurpleBOSHConnection *bosh)
-{
- /* Do nothing if it's already disabled */
- if (!bosh->pipelining)
- return;
-
- purple_debug_info("jabber", "BOSH: Disabling pipelining on conn %p\n",
- bosh);
- bosh->pipelining = FALSE;
- if (bosh->connections[1] == NULL) {
- bosh->connections[1] = jabber_bosh_http_connection_init(bosh);
- http_connection_connect(bosh->connections[1]);
- } else {
- /* Shouldn't happen; this should be the only place pipelining
- * is turned off.
- */
- g_warn_if_reached();
- }
-}
-
static void jabber_bosh_connection_received(PurpleBOSHConnection *conn, xmlnode *node) {
xmlnode *child;
JabberStream *js = conn->js;
@@ -726,11 +697,6 @@ static void http_connection_disconnected(PurpleHTTPConnection *conn)
conn->requests = 0;
}
- if (conn->bosh->pipelining) {
- /* Hmmmm, fall back to multiple connections */
- jabber_bosh_disable_pipelining(conn->bosh);
- }
-
if (!had_requests)
/* If the server disconnected us without any requests, let's
* just wait until we have something to send before we reconnect
@@ -807,7 +773,6 @@ jabber_bosh_http_connection_process(PurpleHTTPConnection *conn)
if (!g_ascii_strncasecmp(tmp, "close", strlen("close"))) {
conn->close = TRUE;
- jabber_bosh_disable_pipelining(conn->bosh);
}
}