Re: cvs: php4 /main network.c
| From: | Wez Furlong | Date: | Mon, 18 Mar 2002 22:07:45 +0000 |
| Subject: | Re: cvs: php4 /main network.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-10380@lists.php.net to get a copy of this message | ||
Hi Derick,
in fsock.c: php_sockread_internal(); the code fits straight into
the equivalent "if (nr_bytes > 0) {" part of the function.
--Wez.
On 19/03/02, derick@php.net wrote:
> Hello Wez,
>
> Exactly where should I add it... I can't find the relevent part in the
> source?
>
> Derick
>
> > > nr_bytes = recv(sock->socket, buf, sock->chunk_size, 0);
> > > if(nr_bytes > 0) {
> > > +
> > > + /* try to avoid ever expanding buffer */
> > > + if (sock->readpos > 0) {
> > > + memmove(sock->readbuf, READPTR(sock), sock->readbuflen - sock->readpos);
> > > + sock->writepos -= sock->readpos;
> > > + sock->readpos = 0;
> > > + }
> > > +
> > > if(sock->writepos + nr_bytes > sock->readbuflen) {
> > > sock->readbuflen += sock->chunk_size;
> > > sock->readbuf = perealloc(sock->readbuf, sock->readbuflen,