From: adrian <> Date: Mon, 21 Oct 2002 12:43:07 +0000 (+0000) Subject: move the udp functions to comm_udp_*, to be consistent with what was X-Git-Tag: SQUID_3_0_PRE1~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d21986b4801f60cdb9fd684e7fcac07eae636f0;p=thirdparty%2Fsquid.git move the udp functions to comm_udp_*, to be consistent with what was in there in the first place. --- diff --git a/src/comm.cc b/src/comm.cc index 2e9335f177..1d4d2fe1b4 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.343 2002/10/21 05:54:12 adrian Exp $ + * $Id: comm.cc,v 1.344 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -554,7 +554,7 @@ fdc_open(int fd, unsigned int type, char *desc) */ int -comm_recvfrom(int fd, void *buf, size_t len, int flags, +comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) { statCounter.syscalls.sock.recvfroms++; @@ -562,13 +562,13 @@ comm_recvfrom(int fd, void *buf, size_t len, int flags, } int -comm_recv(int fd, void *buf, size_t len, int flags) +comm_udp_recv(int fd, void *buf, size_t len, int flags) { - return comm_recvfrom(fd, buf, len, flags, NULL, 0); + return comm_udp_recvfrom(fd, buf, len, flags, NULL, 0); } ssize_t -comm_send(int s, const void *buf, size_t len, int flags) +comm_udp_send(int s, const void *buf, size_t len, int flags) { return send(s, buf, len, flags); } diff --git a/src/comm.h b/src/comm.h index 35bca889b9..8e00ffdbc3 100644 --- a/src/comm.h +++ b/src/comm.h @@ -11,9 +11,9 @@ extern int comm_has_pending_read_callback(int fd); extern int comm_has_pending_read(int fd); 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, +extern int comm_udp_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); -extern ssize_t comm_send(int s, const void *buf, size_t len, int flags); +extern int comm_udp_recv(int fd, void *buf, size_t len, int flags); +extern ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags); #endif diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 3b335cda9d..feeb7a0b14 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.49 2002/10/21 05:45:30 adrian Exp $ + * $Id: dns_internal.cc,v 1.50 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -502,7 +502,7 @@ idnsRead(int fd, void *data) while (max--) { from_len = sizeof(from); memset(&from, '\0', from_len); - len = comm_recvfrom(fd, rbuf, 512, 0, (struct sockaddr *) &from, &from_len); + len = comm_udp_recvfrom(fd, rbuf, 512, 0, (struct sockaddr *) &from, &from_len); if (len == 0) break; if (len < 0) { diff --git a/src/htcp.cc b/src/htcp.cc index c46b87b3dc..84669b9e4e 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.45 2002/10/21 05:45:30 adrian Exp $ + * $Id: htcp.cc,v 1.46 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -893,7 +893,7 @@ htcpRecv(int fd, void *data) static struct sockaddr_in from; socklen_t flen = sizeof(struct sockaddr_in); memset(&from, '\0', flen); - len = comm_recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen); + len = comm_udp_recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen); debug(31, 3) ("htcpRecv: FD %d, %d bytes from %s:%d\n", fd, len, inet_ntoa(from.sin_addr), ntohs(from.sin_port)); htcpHandle(buf, len, &from); diff --git a/src/icmp.cc b/src/icmp.cc index b5d9d7ddce..1cd39844ba 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $Id: icmp.cc,v 1.77 2002/10/21 05:54:36 adrian Exp $ + * $Id: icmp.cc,v 1.78 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -74,7 +74,7 @@ icmpRecv(int unused1, void *unused2) static struct sockaddr_in F; commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0); memset(&preply, '\0', sizeof(pingerReplyData)); - n = comm_recv(icmp_sock, + n = comm_udp_recv(icmp_sock, (char *) &preply, sizeof(pingerReplyData), 0); diff --git a/src/ipc.cc b/src/ipc.cc index b6365ddff6..81e58b201a 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.32 2002/10/21 05:54:36 adrian Exp $ + * $Id: ipc.cc,v 1.33 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -206,7 +206,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name } memset(hello_buf, '\0', HELLO_BUF_SZ); if (type == IPC_UDP_SOCKET) - x = comm_recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0); + x = comm_udp_recv(prfd, hello_buf, HELLO_BUF_SZ - 1, 0); else x = read(prfd, hello_buf, HELLO_BUF_SZ - 1); if (x < 0) { @@ -259,7 +259,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } if (type == IPC_UDP_SOCKET) { - x = comm_send(cwfd, hello_string, strlen(hello_string) + 1, 0); + x = comm_udp_send(cwfd, hello_string, strlen(hello_string) + 1, 0); if (x < 0) { debug(50, 0) ("sendto FD %d: %s\n", cwfd, xstrerror()); debug(50, 0) ("ipcCreate: CHILD: hello write test failed\n"); diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 93ebe55501..8a6db0c654 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.57 2002/10/21 06:34:04 adrian Exp $ + * $Id: snmp_core.cc,v 1.58 2002/10/21 06:43:07 adrian Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -460,7 +460,7 @@ snmpHandleUdp(int sock, void *not_used) memset(&from, '\0', from_len); memset(buf, '\0', SNMP_REQUEST_SIZE); - len = comm_recvfrom(sock, + len = comm_udp_recvfrom(sock, buf, SNMP_REQUEST_SIZE, 0, diff --git a/src/wccp.cc b/src/wccp.cc index 4e67b2bd71..8450f886fb 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp.cc,v 1.27 2002/10/21 05:54:36 adrian Exp $ + * $Id: wccp.cc,v 1.28 2002/10/21 06:43:08 adrian Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -220,7 +220,7 @@ wccpHandleUdp(int sock, void *not_used) memset(&from, '\0', from_len); memset(&wccp_i_see_you, '\0', sizeof(wccp_i_see_you)); - len = comm_recvfrom(sock, + len = comm_udp_recvfrom(sock, (void *) &wccp_i_see_you, WCCP_RESPONSE_SIZE, 0,