From: wessels <> Date: Thu, 31 Oct 1996 04:56:34 +0000 (+0000) Subject: prelim keepalive support X-Git-Tag: SQUID_3_0_PRE1~5559 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb201b7ed2042565e0963fd1584f9bce1b69b049;p=thirdparty%2Fsquid.git prelim keepalive support --- diff --git a/src/client_side.cc b/src/client_side.cc index ca5b3bcd1c..779e2c0781 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.54 1996/10/30 09:27:26 wessels Exp $ + * $Id: client_side.cc,v 1.55 1996/10/30 21:56:34 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -218,11 +218,13 @@ clientRedirectDone(void *data, char *result) } icpParseRequestHeaders(icpState); fd_note(fd, icpState->url); - commSetSelect(fd, - COMM_SELECT_READ, - (PF) icpDetectClientClose, - (void *) icpState, - 0); + if (!BIT_TEST(icpState->request->flags, REQ_PROXY_KEEPALIVE)) { + commSetSelect(fd, + COMM_SELECT_READ, + icpDetectClientClose, + (void *) icpState, + 0); + } icpProcessRequest(fd, icpState); } diff --git a/src/comm.cc b/src/comm.cc index d8be53e9b4..7db3b77c4c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.94 1996/10/29 02:38:16 wessels Exp $ + * $Id: comm.cc,v 1.95 1996/10/30 21:56:35 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -496,11 +496,22 @@ comm_accept(int fd, struct sockaddr_in *peer, struct sockaddr_in *me) return sock; } +void +commCallCloseHandlers(int fd) +{ + FD_ENTRY *conn = &fd_table[fd]; + struct close_handler *ch; + while ((ch = conn->close_handler) != NULL) { + conn->close_handler = ch->next; + ch->handler(fd, ch->data); + safe_free(ch); + } +} + void comm_close(int fd) { FD_ENTRY *conn = NULL; - struct close_handler *ch = NULL; debug(5, 5, "comm_close: FD %d\n", fd); if (fd < 0 || fd >= FD_SETSIZE) return; @@ -515,11 +526,7 @@ comm_close(int fd) RWStateCallbackAndFree(fd, COMM_ERROR); comm_set_fd_lifetime(fd, -1); /* invalidate the lifetime */ fdstat_close(fd); /* update fdstat */ - while ((ch = conn->close_handler) != NULL) { /* Call close handlers */ - conn->close_handler = ch->next; - ch->handler(fd, ch->data); - safe_free(ch); - } + commCallCloseHandlers(fd); memset(conn, '\0', sizeof(FD_ENTRY)); close(fd); }