#25265 [Opn->Bgs]: A new API call to return actual HTTP content-length accurately is needed.

From: Date: Mon, 09 Oct 2006 09:43:16 +0000
Subject: #25265 [Opn->Bgs]: A new API call to return actual HTTP content-length accurately is needed.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103283@lists.php.net to get a copy of this message
ID: 25265 Updated by: mike@php.net Reported By: phpbug at paypc dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: All PHP Version: 5CVS-2003-08-26 (dev) New Comment: I don't see a reasonable way for this. Previous Comments: ------------------------------------------------------------------------ [2003-08-26 18:00:12] phpbug at paypc dot com Description: ------------ Seeing as ob_get_length() is problematic for use in constructing HTTP/1.1 Content-Length: headers due to its design goals being at variance with being used for such purpose, I would like to request a new API call be introduced which *CAN* be used for Content-Length: headers. Such API call should return the correct value with or without trans_sid being enabled, and it should also return the correct result when alternative output handlers (such as the gzhandler) are hooked in. I realise this may take a few releases. :) Thanks! Incidentally, I've find using the ob_* functions to be a complete lifesaver, allowing me to greatly simplify alot of page-scripts... being able to throw a header("Location:") at the "end" of my PHP script allows me immense freedom in handling certain kinds of exceptions, which otherwise would have involved very intricate logic. Cheers, =Lord Apollyon= Reproduce code: --------------- If trans_sid or the gzhandler is used, any call to ob_get_length() will return incorrect values, thus making it useless to generate HTTP/1.1 Content-Length: headers from this value. Since there is nothing else even remotely like this API entry-point to obtain such information, a new one is called for. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25265&edit=1

« previous php.bugs (#103283) next »