1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04:00

test: raw deflate

(cherry picked from commit c48dc625e3)
This commit is contained in:
Witold Filipczyk 2008-02-28 19:17:50 +01:00 committed by Kalle Olavi Niemitalo
parent b0c5da3ddf
commit ac48b3e4e6

View File

@ -1,9 +1,11 @@
#!/usr/bin/env python
import os, time, zlib
import os, time
from zlib import *
data1 = '<html><body>Two lines should be visible.<br/>The second line.</body></html>'
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:]