cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

help! with 'deflate' content-encoding

From: Gaetano Giunta <giunta.gaetano_at_sea-aeroportimilano.it>
Date: Mon, 21 Aug 2006 12:12:56 +0200

I know this migth be more of a 'plain php' bug than a curl one, but sometimes php devs are a bit unresponsive, so I tought I migth ask here:

I have set up an http client in PHP, that takes adavantage of CURL if available, and does the http decoding on its own when curl is not there.
The client can be set to only accept 'deflate' content (or 'gzip', or both, but the pbl only happens with deflate).
When 'Content-Encoding: deflate' is received, the content is inflated using gzinflate($data)

The server encodes the response using either the php zlib.output_compression option or, by hand, using gzdeflate($payload).

What is happening is:
- the CURL client works only when the deflating is carried out by zlib.output_compression, and chokes on gzdeflate'd content
- using gzinflate works on gzdeflate'd data, but chokes on data deflated automagically by php

I have checked all http headers exchanged in the communication, and it all looks fine. No chunked-encoding is used.

I am using php 5.1.5 on windows, and the bundled curl is 7.14.0, w. zlib 1.2.3.
I read in the curl changelog that w. 7.15.4, there was an enhancement: "deflate code survives lack of zlib header". It might have to do with this?

I also have noticed that the response deflated by php is not grokked by a fully-patched IE6, while the gzdeflate'd one is.
FF otoh has no problem with either one...

Any help?

Thanks
Gaetano Giunta

PS: I can set up if needed a web page serving the different responses, for testing purposes...

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-08-21