Do not close connections in keepalive across reloads.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Apr 2018 18:18:02 +0000 (20:18 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Apr 2018 18:18:02 +0000 (20:18 +0200)
main.cpp

index 7da6650..058935d 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -521,7 +521,9 @@ start:
             loaded_state.mutable_clients()->end(),
             OrderByConnectionTime());
        for (int i = 0; i < loaded_state.clients_size(); ++i) {
-               if (all_urls.count(loaded_state.clients(i).url()) == 0) {
+               if (!loaded_state.clients(i).url().empty() &&
+                   all_urls.count(loaded_state.clients(i).url()) == 0) {
+                       // Belongs to a dead stream (not keepalive), so we just have to close.
                        safe_close(loaded_state.clients(i).sock());
                } else {
                        servers->add_client_from_serialized(loaded_state.clients(i), short_response_pool);