From 55cb44f1d6d73b6ee7a6a10453a8c1605ad259ec Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 30 Mar 1998 11:11:13 +0000 Subject: [PATCH] Try httpRestart of httpReadReply read() returns < 0, not just == 0. --- src/http.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/http.cc b/src/http.cc index b3d6fdbe47..13c16dfa31 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.258 1998/03/27 22:44:22 wessels Exp $ + * $Id: http.cc,v 1.259 1998/03/30 04:11:13 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -456,21 +456,22 @@ httpReadReply(int fd, void *data) IOStats.Http.read_hist[bin]++; } if (len < 0) { + debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n", + fd, xstrerror()); if (ignoreErrno(errno)) { commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0); + } else if (entry->mem_obj->inmem_hi == 0 && httpTryRestart(httpState)) { + httpRestart(httpState); + } else if (clen == 0) { + err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR); + err->xerrno = errno; + err->request = requestLink(httpState->orig_request); + errorAppendEntry(entry, err); + comm_close(fd); } else { - if (clen == 0) { - err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR); - err->xerrno = errno; - err->request = requestLink(httpState->orig_request); - errorAppendEntry(entry, err); - } else { - storeAbort(entry, 0); - } + storeAbort(entry, 0); comm_close(fd); } - debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n", - fd, xstrerror()); } else if (len == 0 && entry->mem_obj->inmem_hi == 0) { if (httpTryRestart(httpState)) { httpRestart(httpState); -- 2.47.3