From b089fc559a5dc527ed5e0422e82abf3b1dd5f1b2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 28 Sep 2007 23:32:53 +0000 Subject: EFFECTIVE MERGE: svn merge -r 68999:69916 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance into release ** This should be the last merge from branches/maintenance. All future merges will be from new maintenance-# branches off release ** ACTUAL MERGE: svn merge -r70609:70621 svn+ssh://svn/svn/linden/branches/maintenance-0-qa-r70556 RELATED MERGE: svn merge -r69921:70316 svn+ssh://svn/svn/linden/branches/maintenance-0-qa --- indra/llmessage/llhttpassetstorage.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/llmessage/llhttpassetstorage.cpp') diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 7b07dfd0e0..142e6a50e8 100644 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -316,7 +316,7 @@ size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size) while (mZStream.avail_out > 0) { - if (mZStream.avail_in == 0 && !mZInputExhausted) + if (mZStream.avail_in == 0 && !mZInputExhausted) { S32 to_read = llmin(COMPRESSED_INPUT_BUFFER_SIZE, (S32)(mVFile->getSize() - mVFile->tell())); @@ -324,14 +324,9 @@ size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size) if ( to_read > 0 ) { mVFile->read((U8*)mZInputBuffer, to_read); /*Flawfinder: ignore*/ + mZStream.next_in = (Bytef*)mZInputBuffer; + mZStream.avail_in = mVFile->getLastBytesRead(); } - else - { - llwarns << "LLHTTPAssetRequest::readCompressedData has zero read length" << llendl; - break; - } - mZStream.next_in = (Bytef*)mZInputBuffer; - mZStream.avail_in = mVFile->getLastBytesRead(); mZInputExhausted = mZStream.avail_in == 0; } @@ -339,8 +334,13 @@ size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size) int r = deflate(&mZStream, mZInputExhausted ? Z_FINISH : Z_NO_FLUSH); - if (r == Z_STREAM_END || r < 0) + if (r == Z_STREAM_END || r < 0 || mZInputExhausted) { + if (r < 0) + { + llwarns << "LLHTTPAssetRequest::readCompressedData: deflate returned error code " + << (S32) r << llendl; + } break; } } -- cgit v1.2.3