If FunnelWrite was called with >16K of data at a point when it had none

buffered, the progress updater (which was only called from FunnelFlush)
would never get called.  It turns out "deflate" expansion hits this case
every time.
This commit is contained in:
Andy McFadden 2002-10-11 21:57:38 +00:00
parent 8fefff8cfa
commit 8b14fdaef8

View File

@ -572,8 +572,15 @@ Nu_FunnelWrite(NuArchive* pArchive, NuFunnel* pFunnel, const uchar* buffer,
* blow out what we were just given or put it at the start of * blow out what we were just given or put it at the start of
* the buffer. * the buffer.
*/ */
err = Nu_FunnelFlush(pArchive, pFunnel); if (pFunnel->bufCount) {
BailError(err); err = Nu_FunnelFlush(pArchive, pFunnel);
BailError(err);
} else {
err = Nu_FunnelSendProgressUpdate(pArchive, pFunnel);
BailError(err);
}
Assert(pFunnel->bufCount == 0);
if (count >= kNuFunnelBufSize / 4) { if (count >= kNuFunnelBufSize / 4) {
/* it's more than 25% of the buffer, just write it now */ /* it's more than 25% of the buffer, just write it now */