--------------------- PatchSet 11231 Date: 2007/02/03 22:22:51 Author: hno Branch: HEAD Tag: (none) Log: Move the IPC_DGRAM type check to defines.h where it belongs At least Linux and quite likely several others can handle very large AF_UNIX dgram packets. Note: We should write a configure test for this, instead of hardcoding OS:es. Members: src/defines.h:1.122->1.123 src/icmp.c:1.82->1.83 Index: squid/src/defines.h =================================================================== RCS file: /cvsroot/squid/squid/src/defines.h,v retrieving revision 1.122 retrieving revision 1.123 diff -u -r1.122 -r1.123 --- squid/src/defines.h 29 Nov 2006 15:58:52 -0000 1.122 +++ squid/src/defines.h 3 Feb 2007 22:22:51 -0000 1.123 @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.122 2006/11/29 15:58:52 adrian Exp $ + * $Id: defines.h,v 1.123 2007/02/03 22:22:51 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -216,12 +216,23 @@ #if HAVE_SOCKETPAIR && defined (AF_UNIX) #define IPC_STREAM IPC_UNIX_STREAM -#define IPC_DGRAM IPC_UNIX_DGRAM #else #define IPC_STREAM IPC_TCP_SOCKET +#endif + +/* + * Do NOT use IPC_UNIX_DGRAM here because you can't + * send() more than 4096 bytes on a socketpair() socket + * on FreeBSD + * XXX There should be a configure test for this + */ +#if HAVE_SOCKETPAIR && defined (AF_UNIX) && !defined(_SQUID_FREEBSD_) +#define IPC_DGRAM IPC_UNIX_DGRAM +#else #define IPC_DGRAM IPC_UDP_SOCKET #endif + #define STORE_META_KEY STORE_META_KEY_MD5 #define STORE_META_TLD_START sizeof(int)+sizeof(char) Index: squid/src/icmp.c =================================================================== RCS file: /cvsroot/squid/squid/src/icmp.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- squid/src/icmp.c 25 Jan 2007 01:37:29 -0000 1.82 +++ squid/src/icmp.c 3 Feb 2007 22:22:51 -0000 1.83 @@ -1,6 +1,6 @@ /* - * $Id: icmp.c,v 1.82 2007/01/25 01:37:29 wessels Exp $ + * $Id: icmp.c,v 1.83 2007/02/03 22:22:51 hno Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -190,12 +190,7 @@ int wfd; args[0] = "(pinger)"; args[1] = NULL; - /* - * Do NOT use IPC_DGRAM (=IPC_UNIX_DGRAM) here because you can't - * send() more than 4096 bytes on a socketpair() socket (at - * least on FreeBSD). - */ - pid = ipcCreate(IPC_UDP_SOCKET, + pid = ipcCreate(IPC_DGRAM, Config.Program.pinger, args, "Pinger Socket",