handle ping timeouts from server (#158).
authorJelmer Vernooij <jelmer@samba.org>
Wed, 21 Nov 2007 21:48:15 +0000 (22:48 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 21 Nov 2007 21:48:15 +0000 (22:48 +0100)
NEWS
lib/network.c

diff --git a/NEWS b/NEWS
index 20ba08c..4bc2f17 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ Ctrlproxy 3.0.4 UNRELEASED
 
   BUG FIXES
 
+    * Handle ping timeouts from server. (#158)
+
     * Don't crash when network of listener goes away. (#168)
 
     * Don't abort when sending colon to listener. (#167)
index 7967125..79893f6 100644 (file)
@@ -672,7 +672,9 @@ static void ping_server(struct network *server, gboolean ping_source)
 {
        gint silent_time = time(NULL) - server->connection.last_line_recvd;
        if (silent_time > MAX_SILENT_TIME) {
-               disconnect_network(server);
+               network_report_disconnect(server, "Ping timeout (%d seconds)", 
+                                                                 silent_time);
+               reconnect(server);
        } else if (silent_time > MIN_SILENT_TIME) {
                network_send_args(server, "PING", "ctrlproxy", NULL);
        }