From 1ee13af2a8d2b0a34c4b467248290b7b32fdd33d Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 16 Apr 2003 20:57:38 +0000 Subject: [PATCH] fixed improper unprocessed protocol copy during buffer expansion --- src/cas/generic/inBuf.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cas/generic/inBuf.cc b/src/cas/generic/inBuf.cc index 4e62540fa..b9e9a50db 100644 --- a/src/cas/generic/inBuf.cc +++ b/src/cas/generic/inBuf.cc @@ -161,7 +161,9 @@ void inBuf::expandBuffer () bufSizeT max = this->memMgr.maxSize(); if ( this->bufSize < max ) { casBufferParm bufParm = this->memMgr.allocate ( max ); - memcpy ( bufParm.pBuf, &this->pBuf[this->nextReadIndex], this->bytesPresent () ); + bufSizeT unprocessedBytes = this->bytesPresent (); + memcpy ( bufParm.pBuf, &this->pBuf[this->nextReadIndex], unprocessedBytes ); + this->bytesInBuffer = unprocessedBytes; this->nextReadIndex = 0u; this->memMgr.release ( this->pBuf, this->bufSize ); this->pBuf = bufParm.pBuf;