/*
- * $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
}
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);
}
/*
- * $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
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;
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);
}