Skip to content

Commit e0ce2c9

Browse files
committed
Fix an httpPeek edge case on compressed streams.
1 parent e4897e9 commit e0ce2c9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cups/http.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,9 @@ httpPeek(http_t *http, /* I - HTTP connection */
17951795
stream.next_out = (Bytef *)buffer;
17961796
stream.avail_out = (uInt)length;
17971797

1798-
zerr = inflate(&stream, Z_SYNC_FLUSH);
1798+
zerr = inflate(&stream, Z_SYNC_FLUSH);
1799+
bytes = (ssize_t)(length - stream.avail_out);
1800+
17991801
inflateEnd(&stream);
18001802

18011803
if (zerr < Z_OK)
@@ -1809,8 +1811,6 @@ httpPeek(http_t *http, /* I - HTTP connection */
18091811
return (-1);
18101812
}
18111813

1812-
bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out);
1813-
18141814
# else
18151815
DEBUG_puts("2httpPeek: No inflateCopy on this platform, httpPeek does not "
18161816
"work with compressed streams.");

0 commit comments

Comments
 (0)