From: adrian <> Date: Mon, 21 Oct 2002 11:47:25 +0000 (+0000) Subject: Add in a recv() wrapper - comm_recv(). X-Git-Tag: SQUID_3_0_PRE1~610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=365f12a92856606e8452a59f6ffa37a8f38253d9;p=thirdparty%2Fsquid.git Add in a recv() wrapper - comm_recv(). From FreeBSD's recv/recvfrom: If from is non-nil, and the socket is not connection-oriented, the source address of the message is filled in. Fromlen is a value-result parame- ter, initialized to the size of the buffer associated with from, and mod- ified on return to indicate the actual size of the address stored there. .. so comm_recv() calls recv_from() --- diff --git a/src/comm.cc b/src/comm.cc index c988b99007..6281c43280 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.341 2002/10/21 05:38:32 adrian Exp $ + * $Id: comm.cc,v 1.342 2002/10/21 05:47:25 adrian Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -561,6 +561,12 @@ comm_recvfrom(int fd, void *buf, size_t len, int flags, return recvfrom(fd, buf, len, flags, from, fromlen); } +int +comm_recv(int fd, void *buf, size_t len, int flags) +{ + return comm_recvfrom(fd, buf, len, flags, NULL, 0); +} + /* Older stuff */ diff --git a/src/comm.h b/src/comm.h index b965a17ef9..24e130aa7a 100644 --- a/src/comm.h +++ b/src/comm.h @@ -13,5 +13,6 @@ extern void comm_read_cancel(int fd, IOCB *callback, void *data); extern void fdc_open(int fd, unsigned int type, char *desc); extern int comm_recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); +extern int comm_recv(int fd, void *buf, size_t len, int flags); #endif