Bug 114830 - Konqueror claims deflate support, but doesn't work
Summary: Konqueror claims deflate support, but doesn't work
Status: RESOLVED DUPLICATE of bug 117683
Alias: None
Product: kio
Classification: Unmaintained
Component: http (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-21 19:54 UTC by Michael Williamson
Modified: 2009-04-09 02:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Williamson 2005-10-21 19:54:25 UTC
Version:           3.4.1 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          GCC 3.4.4 
OS:                Linux

Konqueror says that it accepts the following encodings:
x-gzip, x-deflate, gzip, deflate

However, if you try to use deflate with Konqueror it claims the page is corrupt. The code I use is:

std::string page_data = ...;
unsigned long bufferlen = page_data.length();
unsigned char* buffer = new unsigned char[bufferlen+1];
unsigned long out_bufferlen = long(bufferlen*1.1f) + 12L; // requirements of zlib::compress2
unsigned char* out_buffer = new unsigned char[out_bufferlen];
memset(out_buffer,0,out_bufferlen);
strcpy((char*)buffer,page_data.c_str());
compress2(out_buffer,&out_bufferlen,(const unsigned char*)buffer,bufferlen,1);
std::cout << "Content-Type: text/html" << std::endl;
std::cout << "Content-Encoding: deflate" << std::endl;
std::cout << "Content-Length: " << out_bufferlen << std::endl;
std::cout << std::endl;
std::cout.write((const char*)out_buffer,out_bufferlen);

This is from a cgi program in C++ using zlib for compression (include zlib.h and link with -lz).

This code works with Opera, Mozilla, Netscape, Firefox and Internet Explorer, so I think this problem is in Konqueror's support.
Comment 1 Thiago Macieira 2005-10-22 02:08:18 UTC
Confirmed, r470926.
Comment 2 Dawit Alemayehu 2007-09-01 21:17:49 UTC
Marking this report duplicate eventhough it is older than 117683 because there is a lot of comment on the other report.

*** This bug has been marked as a duplicate of 117683 ***
Comment 3 David Faure 2009-04-09 02:19:31 UTC
Thanks for the test code. I just put it up at
http://web.davidfaure.fr/cgi-bin/deflate_test
in order to test a rewritten deflate support.