From ff90330f502ac2175f840c0196e826191e5bd46a Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 22 Dec 2012 04:39:14 +0000 Subject: [PATCH] Fix end-of-request processing for chunked, compressed input - need to break out of the loop to get the state transition to happen. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10781 7a7537e8-13f0-0310-91df-b6672ffda945 --- cups/http.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cups/http.c b/cups/http.c index 371825aa10..ab8fd532d5 100644 --- a/cups/http.c +++ b/cups/http.c @@ -2375,8 +2375,10 @@ httpRead2(http_t *http, /* I - Connection to server */ else bytes = 0; - if (bytes <= 0) + if (bytes < 0) return (bytes); + else if (bytes == 0) + break; http->data_remaining -= bytes; http->stream.avail_in += bytes; @@ -4361,7 +4363,9 @@ http_content_coding_start( return; } - if ((zerr = inflateInit2(&(http->stream), 32 + 15)) < Z_OK) + if ((zerr = inflateInit2(&(http->stream), + coding == _HTTP_CODING_INFLATE ? 15 : 31)) + < Z_OK) { free(http->dbuffer); http->dbuffer = NULL; -- 2.47.2