From 73a3014d28d83613b17615d4eef18e1cd6719aca Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 22 Oct 1997 11:50:28 +0000 Subject: [PATCH] need to check mem_obj->inmem_hi instead of e->object_len because while STORE_PENDING, object_len always == 0. --- src/ftp.cc | 10 +++++----- src/gopher.cc | 4 ++-- src/http.cc | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ftp.cc b/src/ftp.cc index f2b8a4965f..048ab57440 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.142 1997/10/21 19:38:50 wessels Exp $ + * $Id: ftp.cc,v 1.143 1997/10/22 05:50:28 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -233,7 +233,7 @@ ftpTimeout(int fd, void *data) StoreEntry *entry = ftpState->entry; ErrorState *err; debug(9, 4) ("ftpTimeout: FD %d: '%s'\n", fd, entry->url); - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_TIMEOUT; err->http_status = HTTP_GATEWAY_TIMEOUT; @@ -659,7 +659,7 @@ ftpReadData(int fd, void *data) if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { commSetSelect(fd, COMM_SELECT_READ, ftpReadData, data, 0); } else { - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_ERROR; err->errno = errno; @@ -972,7 +972,7 @@ ftpWriteCommandCallback(int fd, char *buf, int size, int errflag, void *data) debug(9, 7) ("ftpWriteCommandCallback: wrote %d bytes\n", size); if (errflag) { debug(50, 1) ("ftpWriteCommandCallback: FD %d: %s\n", fd, xstrerror()); - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_WRITE_ERROR; err->http_status = HTTP_SERVICE_UNAVAILABLE; @@ -1050,7 +1050,7 @@ ftpReadControlReply(int fd, void *data) ftpState, 0); } else { - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_ERROR; err->http_status = HTTP_INTERNAL_SERVER_ERROR; diff --git a/src/gopher.cc b/src/gopher.cc index 262cfc1dc7..5a54882ad9 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $Id: gopher.cc,v 1.99 1997/10/21 19:38:51 wessels Exp $ + * $Id: gopher.cc,v 1.100 1997/10/22 05:50:29 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -653,7 +653,7 @@ gopherTimeout(int fd, void *data) debug(10, 4) ("gopherTimeout: FD %d: '%s'\n", fd, entry->url); /* was assert */ - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_TIMEOUT; err->http_status = HTTP_GATEWAY_TIMEOUT; diff --git a/src/http.cc b/src/http.cc index fbde0e45bb..a7738a9e9c 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.192 1997/10/21 19:38:52 wessels Exp $ + * $Id: http.cc,v 1.193 1997/10/22 05:50:30 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -248,7 +248,7 @@ httpTimeout(int fd, void *data) StoreEntry *entry = httpState->entry; ErrorState *err; debug(11, 4) ("httpTimeout: FD %d: '%s'\n", fd, entry->url); - if (entry->object_len == 0) { + if (entry->mem_obj->inmem_hi == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_TIMEOUT; err->http_status = HTTP_GATEWAY_TIMEOUT; @@ -653,7 +653,7 @@ httpReadReply(int fd, void *data) if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0); } else { - if (entry->object_len == 0) { + if (clen == 0) { err = xcalloc(1, sizeof(ErrorState)); err->type = ERR_READ_ERROR; err->errno = errno; -- 2.47.3