aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2015-04-05 06:19:56 +0000
committercorvid <devnull@localhost>2015-04-05 06:19:56 +0000
commit69a8def1d71fc9885375ecd803731a047005c040 (patch)
tree589892eb3fae35d89171535a6181ecb927320f98
parent57f1256711fcce47b07f69b25e37f6371dd04911 (diff)
http socket reuse must test for HTTP_SOCKET_TO_BE_FREED
-rw-r--r--src/IO/http.c4
1 files changed, 3 insertions, 1 deletions
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);