From bc94fbe64ad5eaea0766aa1c7abdd65b60d6e7c2 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sat, 13 Jun 2015 22:35:03 +1000 Subject: [PATCH] Remove a strange old piece of code apparently for detecting a server gone to lunch This code appears to be some kind of backstop so that the client will notice a server connection that's died because of a network interruption. Checking errno that was last set christ-knows-where is not the right way to do this, though. The normal write to the server for the lag check should eventually see the host/net unreachable error if this happens. --- source/server.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/source/server.c b/source/server.c index 9b88dba..4277380 100644 --- a/source/server.c +++ b/source/server.c @@ -485,7 +485,6 @@ void do_server (fd_set *rd, fd_set *wr) char buffer[BIG_BUFFER_SIZE + 1]; int des, i; -static time_t last_timeout = 0; /* Process server timeouts */ do_idle_server(); @@ -603,7 +602,6 @@ static time_t last_timeout = 0; } default: { - last_timeout = 0; parsing_server_index = i; server_list[i].last_msg = now; parse_server(buffer); @@ -615,17 +613,6 @@ static time_t last_timeout = 0; } from_server = primary_server; } - if (server_list[i].read != -1 && (errno == ENETUNREACH || errno == EHOSTUNREACH)) - { - if (last_timeout == 0) - last_timeout = now; - else if (now - last_timeout > 600) - { - close_server(i, empty_string); - server_list[i].reconnecting = 1; - get_connected(i, -1); - } - } } if (primary_server == -1 || !is_server_open(primary_server))