Re: Update on the lexer-no-stdio patch
| From: | Sascha Schumann | Date: | Tue, 06 May 2003 11:08:17 +0000 |
| Subject: | Re: Update on the lexer-no-stdio patch | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1295@lists.php.net to get a copy of this message | ||
On Tue, 6 May 2003, Wez Furlong wrote:
> beware of the streams own buffer filling code here though.
> (Hmm, I've a feeling we've been here before).
I've committed a workaround now. The code was simply
misplaced.
The proper fix is to use recv(.. MSG_PEEK), e.g. you
determine the length of the HTTP header first and do the real
recv(sock, buf, exact_http_size, 0) afterwards. This will
leave the complete HTTP response body in the socket buffer,
so that the ugly workaround of reading a single character at
a time can be removed.
- Sascha