From 69a8def1d71fc9885375ecd803731a047005c040 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 5 Apr 2015 06:19:56 +0000 Subject: http socket reuse must test for HTTP_SOCKET_TO_BE_FREED --- src/IO/http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/IO/http.c b/src/IO/http.c index a0512873..27d86263 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -673,7 +673,9 @@ static void Http_socket_reuse(int SKey) for (i = 0; i < n; i++) { new_sd = dList_nth_data(hc->queue, i); - if (a_Web_valid(new_sd->web) && old_sd->port == new_sd->port) { + if (old_sd->port == new_sd->port && + !(new_sd->flags & HTTP_SOCKET_TO_BE_FREED) && + a_Web_valid(new_sd->web)) { new_sd->SockFD = old_sd->SockFD; Http_fd_map_remove_entry(old_sd->SockFD); a_Klist_remove(ValidSocks, SKey); -- cgit v1.2.3