Re: Why use read() in helper.c ?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 28 Apr 2002 14:08:10 +0200

Robert?

On Sunday 28 April 2002 11:25, Guido Serassio wrote:
> Hi Henrik,
>
> A little question:
> In helper.c, the function helperHandleRead() use the FD_READ_METHOD
> macro to read from socket, in helperStatefulHandleRead() is used
> read(). I think that there is no special reason for this.
> On nt port the FD_READ_METHOD macro is very useful, because I need
> to use recv() instead of read(), so, this is the patch.
>
> Index: helper.c
> ===================================================================
> RCS file: /cvsroot/squid/squid/src/helper.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 helper.c
> --- helper.c 13 Apr 2002 23:09:17 -0000 1.17
> +++ helper.c 28 Apr 2002 09:17:56 -0000
> @@ -756,7 +756,7 @@ helperStatefulHandleRead(int fd, void *d
> assert(fd == srv->rfd);
> assert(cbdataReferenceValid(data));
> statCounter.syscalls.sock.reads++;
> - len = read(fd, srv->buf + srv->offset, srv->buf_sz -
> srv->offset); + len = FD_READ_METHOD(fd, srv->buf + srv->offset,
> srv->buf_sz - srv->offset);
> fd_bytes(fd, len, FD_READ);
> debug(29, 5) ("helperStatefulHandleRead: %d bytes from %s
> #%d.\n", len, hlp->id_name, srv->index + 1);
>
> Regards
>
> Guido
>
>
>
> -
> =======================================================
> Serassio Guido
> Via Albenga, 11/4 10134 -
> Torino - ITALY E-mail: guido.serassio@serassio.it
> WWW: http://www.serassio.it
Received on Sun Apr 28 2002 - 06:20:30 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:22 MST