]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fix the cause for sc->cmp_offset == copy_offset and assert if someone reintroduces it
authorrobertc <>
Thu, 19 Sep 2002 17:15:25 +0000 (17:15 +0000)
committerrobertc <>
Thu, 19 Sep 2002 17:15:25 +0000 (17:15 +0000)
src/client_side_reply.cc

index 13afc470f8d2284b2f930fc224529edfa0ea431f..c8e239129a52e3a186ce395f8e8f22d6b70a8d4b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.5 2002/09/15 20:57:19 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.6 2002/09/19 11:15:25 robertc Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -416,6 +416,9 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
        /* here the data to send is the data we just recieved */
        context->old_reqofs = 0;
        context->old_reqsize = 0;
+       /* clientSendMoreData tracks the offset as well. 
+        * Force it back to zero */
+       context->reqofs = 0;
        assert(!EBIT_TEST(entry->flags, ENTRY_ABORTED));
        /* TODO: provide SendMoreData with the ready parsed reply */
        clientSendMoreData(context, context->tempbuf, context->reqsize);
@@ -1369,6 +1372,11 @@ clientSendMoreData(void *data, char *retbuf, ssize_t retsize)
     ssize_t size = context->reqofs + retsize;
     ssize_t body_size = size;
 
+    /* This is not valid once we start doing range requests.
+     * Then it becomes context->reqofs == startoffirstrangeentry
+     */
+    assert (context->reqofs == 0 || context->flags.headersSent);
+
     if (buf != retbuf) {
        /* we've got to copy some data */
        assert(retsize <= next->readlen);