From af29fa8651ba3afa012ab5ef81a689e6874157b8 Mon Sep 17 00:00:00 2001 From: robertc <> Date: Thu, 19 Sep 2002 17:15:25 +0000 Subject: [PATCH] fix the cause for sc->cmp_offset == copy_offset and assert if someone reintroduces it --- src/client_side_reply.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 13afc470f8..c8e239129a 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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); -- 2.47.2