c-rack / squid-ecap-gzip

SQUID eCAP GZIP Adapter
GNU General Public License v2.0
20 stars 8 forks source link

gzip adapter #21

Closed joegzip closed 8 years ago

joegzip commented 8 years ago

squid restart on some object after digging around i put switch on deflate() function switch (rc) and wat i found is Z_STREAM_ERROR: making squid restart The stream state was inconsistent (e.g., next_in or next_out was NULL).

gzipContext->zstream.next_in    = (Bytef*) vb.start;
gzipContext->zstream.avail_in = vb.size;
gzipContext->zstream.next_out = (Bytef*) &gzipContext->gzipBuffer[gzipContext->compressedSize];
gzipContext->zstream.avail_out = 256 + gzipContext->originalSize - gzipContext->compressedSize;
gzipContext->zstream.total_out = 0;

those shuld be corrected or the buffer is out of space some how

on debian 7 and 8 same problem i have latest ecap lib and latest squid

c-rack commented 8 years ago

Thanks for reporting. Feel free to submit a pull request to fix it.

joegzip commented 8 years ago

also i see this deflate() function Ran out of output buffer for writing compressed bytes. the first post error i did long test on wat the cause and i foundcharset Content-Type: text/html; charset= <----- with charset fire the Z_STREAM_ERROR wat i did if(strstr(contentTypeString.c_str(),"text/") && ! strstr(contentTypeString.c_str(),"charset")) { i dont see that err any more so any idea why pls