From: Steinar H. Gunderson Date: Sun, 22 Apr 2018 18:18:02 +0000 (+0200) Subject: Do not close connections in keepalive across reloads. X-Git-Tag: 1.4.0~9 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=49851eb86428de7a76b00ea4067cdf32c28e7397 Do not close connections in keepalive across reloads. --- diff --git a/main.cpp b/main.cpp index 7da6650..058935d 100644 --- 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);