Re: cvs: pear /HTTP_Request Request.php
| From: | moshe doron | Date: | Wed, 08 Oct 2003 06:56:33 +0000 |
| Subject: | Re: cvs: pear /HTTP_Request Request.php | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22461@lists.php.net to get a copy of this message | ||
> BTW. I'm also finding a way to support the '100 continue' HTTP status. PHP
> bug: 25486.
> My best solution so far (didn't test it) is a regular expression based
split
> on the HTTP/1.1 headers.
> To my opinion the last item in the returned array should assigned the
> $response variable where now the socket is read.
>
> resulting in something like: (near line 709)
> $fullRespone = $sock->readAll();
> $reponseParts = preg_split("^HTTP/1.[0|1"\ \d{3}\ .*\n$",
$fullResponse, -1,
> PREG_SPLIT_NO_EMPTY); //split on HTTP header
> $response = array_pop($responseParts); //returning last element
here my implementation for the bad HTTP_Response code this code deal with:
1. 100
2. cookies wrong urlencode
3. improving the the flow structure by removing duplicate code into else\if.
http://moshe.i-com-it.com/patchs/HTTP_Request.3.txt
anyway your implementaion is bad coz we need the headers of the 100 chunk
into the 200 (or whatever) one (e.g, times cookies are send on the 100
chunk).
--
moshe