]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add in a recv() wrapper - comm_recv().
authoradrian <>
Mon, 21 Oct 2002 11:47:25 +0000 (11:47 +0000)
committeradrian <>
Mon, 21 Oct 2002 11:47:25 +0000 (11:47 +0000)
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()

src/comm.cc
src/comm.h

index c988b990074ebd84f69c25195f7032677ac697d4..6281c4328005c01e33ab4c120fd05646e8ea0caf 100644 (file)
@@ -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 */
index b965a17ef9cafe13de1b32783e81fb224bc6f811..24e130aa7a19594b5855de023e7c618661c4f124 100644 (file)
@@ -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