Re: Re: Fixing socket reads
| From: | Andrei Zmievski | Date: | Fri, 04 Oct 2002 15:17:31 +0000 |
| Subject: | Re: Re: Fixing socket reads | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-89008@lists.php.net to get a copy of this message | ||
On Fri, 04 Oct 2002, Sascha Schumann wrote:
> Here is a second patch, with a third coming some time later.
>
> The current stream implementation does not consume its
> buffered data before starting new reads. That causes serious
> problems with sockets, of course, if you have an application
> which exchanges commands/replies with a server. The
> stream_gets function reads many lines, returns a single one,
> and then tries to read from the network again.
>
> The patch changes the semantic: Consume the buffer first,
> then call the stream read op.
>
> My fgets-based pop3 reader works with this patch already. I
> suspect that fread exposes similar problems though, but I
> don't have time right now to improve it similarly.
Guys,
Are we going to have the streams stuff sorted before tomorrow?
-Andrei http://www.gravitonic.com/
"The human brain is a wonderful thing. It starts working the moment you
are born, and never stops until you stand up to speak in public. "
-- Sir George Jessel