From 8b14fdaef8ea9e3f9baf6cd241052aef5cc3e939 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Fri, 11 Oct 2002 21:57:38 +0000 Subject: [PATCH] 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. --- nufxlib-0/Funnel.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nufxlib-0/Funnel.c b/nufxlib-0/Funnel.c index 0422513..6032fae 100644 --- a/nufxlib-0/Funnel.c +++ b/nufxlib-0/Funnel.c @@ -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 * the buffer. */ - err = Nu_FunnelFlush(pArchive, pFunnel); - BailError(err); + if (pFunnel->bufCount) { + err = Nu_FunnelFlush(pArchive, pFunnel); + BailError(err); + } else { + err = Nu_FunnelSendProgressUpdate(pArchive, pFunnel); + BailError(err); + } + + Assert(pFunnel->bufCount == 0); if (count >= kNuFunnelBufSize / 4) { /* it's more than 25% of the buffer, just write it now */