From ac48b3e4e61adb307d649e3cde9fd4c411f8fa8e Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 28 Feb 2008 19:17:50 +0100 Subject: [PATCH] test: raw deflate (cherry picked from commit c48dc625e38d085f34d39bbea57b3877cd5f9f67) --- test/cgi/chunked_deflate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/cgi/chunked_deflate.py b/test/cgi/chunked_deflate.py index 45f06828..5300c575 100755 --- a/test/cgi/chunked_deflate.py +++ b/test/cgi/chunked_deflate.py @@ -1,9 +1,11 @@ #!/usr/bin/env python -import os, time, zlib +import os, time +from zlib import * data1 = 'Two lines should be visible.
The second line.' -cd1 = zlib.compress(data1) - +ob = compressobj(Z_DEFAULT_COMPRESSION, DEFLATED, -MAX_WBITS) +cd1 = ob.compress(data1) +cd1 += ob.flush() length = len(cd1) next_chunk = hex(length - 10)[2:]