Re: Support for "Transfer-Encoding: chunked" in http stream wrapper
| From: | Stanislav Malyshev | Date: | Tue, 14 Apr 2009 23:44:50 +0000 |
| Subject: | Re: Support for "Transfer-Encoding: chunked" in http stream wrapper | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43707@lists.php.net to get a copy of this message | ||
Hi!
The attached patch implements automatic decoding of chunked transfer-encoding.From what I see in the patch, it requires chunked data prefix to be: XXX\r\n where XXX are from 1 to 3 hex digits. However RFC 2616 defines chunk size as arbitrarily long sequence of HEX digits, and also allows for some stuff (extensions) to be added to the end. I wonder if it'd be better to treat all hex digits as size and then ignore everything until \r\n. Also, I understand that by the RFC chunked encoding should never be sent to HTTP/1.0 clients. So, by default this should never happen unless you manually set protocol version to 1.1 (or the server is broken). -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com