fixed improper unprocessed protocol copy during buffer expansion

This commit is contained in:
Jeff Hill
2003-04-16 20:57:38 +00:00
parent ff16932a0f
commit 1ee13af2a8

View File

@@ -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;