php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25265 A new API call to return actual HTTP content-length accurately is needed.
Submitted: 2003-08-26 18:00 UTC Modified: 2006-10-09 09:43 UTC
From: phpbug at paypc dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5CVS-2003-08-26 (dev) OS: All
Private report: No CVE-ID: None
 [2003-08-26 18:00 UTC] 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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-09 09:43 UTC] mike@php.net
I don't see a reasonable way for this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC