From: wessels <> Date: Fri, 25 Oct 1996 02:58:08 +0000 (+0000) Subject: Added httpState->eof field. Need to detect end-of-object from the server X-Git-Tag: SQUID_3_0_PRE1~5602 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f86a6a46e55327ecfd8252f791b7d25fd14a43f3;p=thirdparty%2Fsquid.git Added httpState->eof field. Need to detect end-of-object from the server _before_ calling storeComplete and changing the store_status to STORE_OK. --- diff --git a/src/http.cc b/src/http.cc index 1b22da6c43..1534ef4555 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.85 1996/10/17 11:14:45 wessels Exp $ + * $Id: http.cc,v 1.86 1996/10/24 20:58:08 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -313,7 +313,7 @@ httpProcessReplyHeader(HttpStateData * httpState, char *buf, int size) } t = httpState->reply_hdr + hdr_len; /* headers can be incomplete only if object still arriving */ - if (entry->store_status == STORE_PENDING) + if (!httpState->eof) if ((t = mime_headers_end(httpState->reply_hdr)) == NULL) return; /* headers not complete */ *t = '\0'; @@ -481,12 +481,14 @@ httpReadReply(int fd, void *data) comm_close(fd); } } else if (len == 0 && entry->mem_obj->e_current_len == 0) { + httpState->eof = 1; squid_error_entry(entry, ERR_ZERO_SIZE_OBJECT, errno ? xstrerror() : NULL); comm_close(fd); } else if (len == 0) { /* Connection closed; retrieval done. */ + httpState->eof = 1; if (httpState->reply_hdr_state < 2) httpProcessReplyHeader(httpState, buf, len); storeAppend(entry, buf, len); /* invoke handlers! */