Re: cvs: php4(PHP_4_3) /ext/zlib zlib.c

From: Date: Wed, 21 May 2003 19:00:01 +0000
Subject: Re: cvs: php4(PHP_4_3) /ext/zlib zlib.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21189@lists.php.net to get a copy of this message
Firstly, sorry for the mess. I probably should have discussed it first. On Wed, May 21, 2003 at 06:23:08PM +0200, Sascha Schumann wrote: > Regardless, the patch is very likely flawed -- setting CL has > been tried several times, and it was shot down every time. > > date: 2001/08/16 23:34:25; author: zeev; state: Exp; lines: +4 -4 > Send Content-Length if we're sending just one chunk > > [snip] > > date: 2002/05/04 23:23:16; author: zeev; state: Exp; lines: +1 -17 > We shouldn't force Content-length:, but much worse, it's wrong in many > cases (basically, unless you use output buffering to buffer all of > your conten it won't work; output buffering is used for lots of > different things as a functional interface, and such buffers have no > relation to Content-type at all). AFAIK Zeev's last comment was only about a Content-Length header on _any_ output buffer which is indeed wrong. I thought that the Content-Length header got lost _accidentally_ while Yasuo moved some stuff from zlib.c to output.c and someone else _removed_ his stuff from output.c instead of moving it back to zlib.c. I thought this was a safe patch. On Thu, May 22, 2003 at 01:51:59AM +0900, Moriyoshi Koizumi wrote: > As Sascha mentioned already, this patch doesn't look valid for me. > zlib.output_complession can be used with chunked buffering and > so php_zlib_output_handler() may be called more than once. > At that time handled_output_len should be set to the length of the > chunk being handled rather than the total length of the content > itself. As far as I can see it's still a valid patch, although it's limited. It only sends a Content-Length header if the output handler is called once - that is, if do_start AND do_end are set, if this is the first and the last call. Zeev made it that way, see the comment above. So it will send the right Content-Lenght in most cases, and it won't do anything in the other cases. Sander

« previous php.cvs (#21189) next »