note 96094 deleted from function.ob-get-length by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Feb 2010 17:39:33 +0000 |
| Subject: | note 96094 deleted from function.ob-get-length by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165760@lists.php.net to get a copy of this message | ||
Note Submitter: db-removetrap AT elunia DOT ch
----
"Transfer-Length" is NOT a rfc2616 Header Field definition.
So please ignore the advice from Anonymous to use it as a substitute for "Content-Length".
Also notice the difference between "Transfer-Encoding" which IS a Header Field definition
and "Transfer-Length" which IS NOT.
What is mentioned in the rfc2616 is in section:
4.4 Message Length
...
3. If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs
represents both the entity-length and the transfer-length. The Content-Length header field MUST NOT
be sent if these two lengths are different (i.e., if a Transfer-Encoding header field is present).
If a message is received with both a Transfer-Encoding header field and a Content-Length header
field,the latter MUST be ignored.
...
What this means is a little contradictory, because the rfc says MUST NOT be sent together and then
it says IF sent together Content-Length MUST be ignored.
So I would take this more as a guideline than a rule to not send them together because if you do
send them together the browser *SHOULD* ignore the Content-Length header anyway.
The most important thing, from a PHP "entity-length/transfer-length" header setting
perspective, is that IF you send a "Transfer-Encoding: chunked;" header make sure your
chunks are correctly encoded so that a chunk length can be determined.
Please see Wikipedia for a nice simple overview and as a starting point of chunked transfer
encoding: http://en.wikipedia.org/wiki/Chunked_transfer_encoding