]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added httpState->eof field. Need to detect end-of-object from the server
authorwessels <>
Fri, 25 Oct 1996 02:58:08 +0000 (02:58 +0000)
committerwessels <>
Fri, 25 Oct 1996 02:58:08 +0000 (02:58 +0000)
_before_ calling storeComplete and changing the store_status to STORE_OK.

src/http.cc

index 1b22da6c43d7ce4c11224e1b79d8e5ca99d92022..1534ef4555516e1a91e84e686852dbdb3aea0ce8 100644 (file)
@@ -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! */