aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-mqtt.c
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-17 13:15:27 -0500
committerjgeboski <jgeboski@gmail.com>2015-01-17 13:15:27 -0500
commit3ec4eca3a75255de6ee36793d665d5b0e0ff5d7e (patch)
tree0a606de23ed62e324fc6599fad5a2e8d554cf02d /facebook/facebook-mqtt.c
parent0b5eebec7ad0f8d731ddc70b68c902d3f795c6f1 (diff)
downloadbitlbee-facebook-3ec4eca3a75255de6ee36793d665d5b0e0ff5d7e.tar.gz
bitlbee-facebook-3ec4eca3a75255de6ee36793d665d5b0e0ff5d7e.tar.bz2
bitlbee-facebook-3ec4eca3a75255de6ee36793d665d5b0e0ff5d7e.tar.xz
facebook-mqtt: fixed preemptive connection timeouts
As it stands, a connection is declared as being timed out if it has not heard back from the server with a ping response in one keep-alive time interval. However, the MQTT specification states that a connection is only declared timed out after one and a half time intervals. While the effects of this oversight may not be immediately present, over a period uptime, the connection may fall victim to preemptive timeouts.
Diffstat (limited to 'facebook/facebook-mqtt.c')
-rw-r--r--facebook/facebook-mqtt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/facebook/facebook-mqtt.c b/facebook/facebook-mqtt.c
index 88f9c94..46af995 100644
--- a/facebook/facebook-mqtt.c
+++ b/facebook/facebook-mqtt.c
@@ -194,7 +194,7 @@ static void fb_mqtt_timeout(fb_mqtt_t *mqtt)
g_return_if_fail(mqtt != NULL);
fb_mqtt_timeout_clear(mqtt);
- mqtt->tev = b_timeout_add(FB_MQTT_TIMEOUT, fb_mqtt_cb_timeout, mqtt);
+ mqtt->tev = b_timeout_add(FB_MQTT_TIMEOUT_CONN, fb_mqtt_cb_timeout, mqtt);
}
/**
@@ -232,7 +232,7 @@ static void fb_mqtt_ping(fb_mqtt_t *mqtt)
g_return_if_fail(mqtt != NULL);
fb_mqtt_timeout_clear(mqtt);
- mqtt->tev = b_timeout_add(FB_MQTT_TIMEOUT, fb_mqtt_cb_ping, mqtt);
+ mqtt->tev = b_timeout_add(FB_MQTT_TIMEOUT_PING, fb_mqtt_cb_ping, mqtt);
}
/**