From c07aed636d12ed1f94549ddce40519a1bfd45a52 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 9 Jun 1998 11:54:12 +0000 Subject: [PATCH] debugging --- src/client_side.cc | 22 ++++++++++++---------- src/comm.cc | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/client_side.cc b/src/client_side.cc index bbc707867c..f2928636d5 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.332 1998/06/05 17:34:16 wessels Exp $ + * $Id: client_side.cc,v 1.333 1998/06/09 05:54:12 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1582,6 +1582,7 @@ clientKeepaliveNextRequest(clientHttpRequest * http) { ConnStateData *conn = http->conn; StoreEntry *entry; + debug(33,3)("clientKeepaliveNextRequest: FD %d\n", conn->fd); conn->defer.until = 0; /* Kick it to read a new request */ httpRequestFree(http); if ((http = conn->chr) != NULL) { @@ -1590,7 +1591,7 @@ clientKeepaliveNextRequest(clientHttpRequest * http) entry = http->entry; if (0 == storeClientCopyPending(entry, http)) { if (entry->store_status == STORE_ABORTED) - debug(33, 0) ("clientWriteComplete: entry->swap_status == STORE_ABORTED\n"); + debug(33, 0) ("clientKeepaliveNextRequest: entry->swap_status == STORE_ABORTED\n"); storeClientCopy(entry, http->out.offset, http->out.offset, @@ -1600,7 +1601,7 @@ clientKeepaliveNextRequest(clientHttpRequest * http) http); } } else { - debug(33, 5) ("clientWriteComplete: FD %d reading next request\n", + debug(33, 5) ("clientKeepaliveNextRequest: FD %d reading next request\n", conn->fd); fd_note(conn->fd, "Reading next request"); /* @@ -1647,13 +1648,14 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da } else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) { debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd); /* We're finished case */ - if (http->entry->mem_obj->reply->content_length < 0 || !done || - EBIT_TEST(entry->flag, ENTRY_BAD_LENGTH)) { - /* - * Client connection closed due to unknown or invalid - * content length. Persistent connection is not possible. - * This catches most cases, but probably not all. - */ + if (http->entry->mem_obj->reply->content_length < 0) { + debug(33,5)("clientWriteComplete: closing, content_length < 0\n"); + comm_close(fd); + } else if (!done) { + debug(33,5)("clientWriteComplete: closing, !done\n"); + comm_close(fd); + } else if (EBIT_TEST(entry->flag, ENTRY_BAD_LENGTH)) { + debug(33,5)("clientWriteComplete: closing, ENTRY_BAD_LENGTH\n"); comm_close(fd); } else if (EBIT_TEST(http->request->flags, REQ_PROXY_KEEPALIVE)) { debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", fd); diff --git a/src/comm.cc b/src/comm.cc index e0429a6ba1..09b4549de2 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.267 1998/05/30 19:43:05 rousskov Exp $ + * $Id: comm.cc,v 1.268 1998/06/09 05:54:33 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1317,6 +1317,7 @@ commHandleWrite(int fd, void *data) nleft = state->size - state->offset; len = write(fd, state->buf + state->offset, nleft); + debug(5,5)("commHandleWrite: write() returns %d\n", len); fd_bytes(fd, len, FD_WRITE); if (len == 0) { -- 2.47.3