---------------------
PatchSet 2879 
Date: 2001/08/26 20:28:24
Author: hno
Branch: hno-emara
Tag: (none) 
Log:
Merged in unix_sockets

Members: 
	configure.in:1.24.4.1->1.24.4.2 
	src/defines.h:1.13->1.13.4.1 
	src/dns.c:1.6->1.6.46.1 
	src/external_acl.c:1.1.12.1->1.1.12.2 
	src/icmp.c:1.4->1.4.58.1 
	src/ipc.c:1.4->1.4.58.1 
	src/locrewrite.c:1.1.24.1->1.1.24.2 
	src/redirect.c:1.7.44.1->1.7.44.2 
	src/unlinkd.c:1.5->1.5.48.1 
	src/auth/basic/auth_basic.c:1.12->1.12.6.1 
	src/auth/ntlm/auth_ntlm.c:1.11->1.11.6.1 

Index: squid/configure.in
===================================================================
RCS file: /cvsroot/squid-sf//squid/configure.in,v
retrieving revision 1.24.4.1
retrieving revision 1.24.4.2
diff -u -r1.24.4.1 -r1.24.4.2
--- squid/configure.in	26 Aug 2001 20:02:40 -0000	1.24.4.1
+++ squid/configure.in	26 Aug 2001 20:28:24 -0000	1.24.4.2
@@ -3,13 +3,13 @@
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.24.4.1 2001/08/26 20:02:40 hno Exp $
+dnl  $Id: configure.in,v 1.24.4.2 2001/08/26 20:28:24 hno Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.24.4.1 $)dnl
+AC_REVISION($Revision: 1.24.4.2 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -1495,6 +1495,7 @@
 	setsid \
 	sigaction \
 	snprintf \
+	socketpair \
 	srand48 \
 	srandom \
 	statfs \
Index: squid/src/defines.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/defines.h,v
retrieving revision 1.13
retrieving revision 1.13.4.1
diff -u -r1.13 -r1.13.4.1
--- squid/src/defines.h	16 Aug 2001 07:39:03 -0000	1.13
+++ squid/src/defines.h	26 Aug 2001 20:28:24 -0000	1.13.4.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: defines.h,v 1.13 2001/08/16 07:39:03 squidadm Exp $
+ * $Id: defines.h,v 1.13.4.1 2001/08/26 20:28:24 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -189,6 +189,16 @@
 #define IPC_TCP_SOCKET 1
 #define IPC_UDP_SOCKET 2
 #define IPC_FIFO 3
+#define IPC_UNIX_STREAM 4
+#define IPC_UNIX_DGRAM 5
+
+#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
+#define IPC_DGRAM IPC_UDP_SOCKET
+#endif
 
 #define STORE_META_KEY STORE_META_KEY_MD5
 
Index: squid/src/dns.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/dns.c,v
retrieving revision 1.6
retrieving revision 1.6.46.1
diff -u -r1.6 -r1.6.46.1
--- squid/src/dns.c	16 Mar 2001 17:22:13 -0000	1.6
+++ squid/src/dns.c	26 Aug 2001 20:28:24 -0000	1.6.46.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns.c,v 1.6 2001/03/16 17:22:13 squidadm Exp $
+ * $Id: dns.c,v 1.6.46.1 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -54,7 +54,7 @@
     if (dnsservers == NULL)
 	dnsservers = helperCreate("dnsserver");
     dnsservers->n_to_start = Config.dnsChildren;
-    dnsservers->ipc_type = IPC_TCP_SOCKET;
+    dnsservers->ipc_type = IPC_STREAM;
     assert(dnsservers->cmdline == NULL);
     wordlistAdd(&dnsservers->cmdline, Config.Program.dnsserver);
     if (Config.onoff.res_defnames)
Index: squid/src/external_acl.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/external_acl.c,v
retrieving revision 1.1.12.1
retrieving revision 1.1.12.2
diff -u -r1.1.12.1 -r1.1.12.2
--- squid/src/external_acl.c	26 Aug 2001 20:02:41 -0000	1.1.12.1
+++ squid/src/external_acl.c	26 Aug 2001 20:28:24 -0000	1.1.12.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: external_acl.c,v 1.1.12.1 2001/08/26 20:02:41 hno Exp $
+ * $Id: external_acl.c,v 1.1.12.2 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 82    External ACL
  * AUTHOR: Henrik Nordstrom
@@ -541,7 +541,7 @@
 	    p->helper = helperCreate(p->name);
 	p->helper->cmdline = p->cmdline;
 	p->helper->n_to_start = p->children;
-	p->helper->ipc_type = IPC_TCP_SOCKET;
+	p->helper->ipc_type = IPC_STREAM;
 	helperOpenServers(p->helper);
     }
     if (firstTimeInit) {
Index: squid/src/icmp.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/icmp.c,v
retrieving revision 1.4
retrieving revision 1.4.58.1
diff -u -r1.4 -r1.4.58.1
--- squid/src/icmp.c	12 Jan 2001 08:20:33 -0000	1.4
+++ squid/src/icmp.c	26 Aug 2001 20:28:24 -0000	1.4.58.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.c,v 1.4 2001/01/12 08:20:33 hno Exp $
+ * $Id: icmp.c,v 1.4.58.1 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -196,7 +196,7 @@
     int wfd;
     args[0] = "(pinger)";
     args[1] = NULL;
-    x = ipcCreate(IPC_UDP_SOCKET,
+    x = ipcCreate(IPC_DGRAM,
 	Config.Program.pinger,
 	args,
 	"Pinger Socket",
@@ -206,6 +206,7 @@
 	return;
     assert(rfd == wfd);
     icmp_sock = rfd;
+    fd_note (icmp_sock, "pinger");
     commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
     commSetTimeout(icmp_sock, -1, NULL, NULL);
     debug(29, 1) ("Pinger socket opened on FD %d\n", icmp_sock);
Index: squid/src/ipc.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/ipc.c,v
retrieving revision 1.4
retrieving revision 1.4.58.1
diff -u -r1.4 -r1.4.58.1
--- squid/src/ipc.c	12 Jan 2001 08:20:33 -0000	1.4
+++ squid/src/ipc.c	26 Aug 2001 20:28:24 -0000	1.4.58.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipc.c,v 1.4 2001/01/12 08:20:33 hno Exp $
+ * $Id: ipc.c,v 1.4.58.1 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 54    Interprocess Communication
  * AUTHOR: Duane Wessels
@@ -123,6 +123,29 @@
 	fd_open(cwfd = p2c[1], FD_PIPE, "IPC FIFO Child Write");
 	fd_open(crfd = c2p[0], FD_PIPE, "IPC FIFO Child Read");
 	fd_open(pwfd = c2p[1], FD_PIPE, "IPC FIFO Parent Write");
+#if HAVE_SOCKETPAIR && defined(AF_UNIX)
+    } else if (type == IPC_UNIX_STREAM) {
+	int fds[2];
+	int buflen = 32768;
+	if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
+	    debug(50, 0) ("ipcCreate: socketpair: %s\n", xstrerror());
+	    return -1;
+	}
+	setsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, (void *)&buflen, sizeof(buflen));
+	setsockopt(fds[0], SOL_SOCKET, SO_RCVBUF, (void *)&buflen, sizeof(buflen));
+	setsockopt(fds[1], SOL_SOCKET, SO_SNDBUF, (void *)&buflen, sizeof(buflen));
+	setsockopt(fds[1], SOL_SOCKET, SO_RCVBUF, (void *)&buflen, sizeof(buflen));
+	fd_open(prfd = pwfd = fds[0], FD_PIPE, "IPC UNIX STREAM Parent");
+	fd_open(crfd = cwfd = fds[1], FD_PIPE, "IPC UNIX STREAM Parent");
+    } else if (type == IPC_UNIX_DGRAM) {
+	int fds[2];
+	if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) < 0) {
+	    debug(50, 0) ("ipcCreate: socketpair: %s\n", xstrerror());
+	    return -1;
+	}
+	fd_open(prfd = pwfd = fds[0], FD_PIPE, "IPC UNIX DGRAM Parent");
+	fd_open(crfd = cwfd = fds[1], FD_PIPE, "IPC UNIX DGRAM Parent");
+#endif
     } else {
 	assert(IPC_NONE);
     }
Index: squid/src/locrewrite.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/locrewrite.c,v
retrieving revision 1.1.24.1
retrieving revision 1.1.24.2
diff -u -r1.1.24.1 -r1.1.24.2
--- squid/src/locrewrite.c	26 Aug 2001 20:02:41 -0000	1.1.24.1
+++ squid/src/locrewrite.c	26 Aug 2001 20:28:24 -0000	1.1.24.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: locrewrite.c,v 1.1.24.1 2001/08/26 20:02:41 hno Exp $
+ * $Id: locrewrite.c,v 1.1.24.2 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Henrik Nordstrom
@@ -137,7 +137,7 @@
 	locrewriters = helperCreate("location_rewriter");
     locrewriters->cmdline = Config.Program.location_rewrite.command;
     locrewriters->n_to_start = Config.Program.location_rewrite.children;
-    locrewriters->ipc_type = IPC_TCP_SOCKET;
+    locrewriters->ipc_type = IPC_STREAM;
     helperOpenServers(locrewriters);
     if (!init) {
 	cachemgrRegister("location_rewriter",
Index: squid/src/redirect.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/redirect.c,v
retrieving revision 1.7.44.1
retrieving revision 1.7.44.2
diff -u -r1.7.44.1 -r1.7.44.2
--- squid/src/redirect.c	26 Aug 2001 20:02:41 -0000	1.7.44.1
+++ squid/src/redirect.c	26 Aug 2001 20:28:24 -0000	1.7.44.2
@@ -1,6 +1,6 @@
 
 /*
- * $Id: redirect.c,v 1.7.44.1 2001/08/26 20:02:41 hno Exp $
+ * $Id: redirect.c,v 1.7.44.2 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -160,7 +160,7 @@
 	redirectors = helperCreate("url_rewriter");
     redirectors->cmdline = Config.Program.url_rewrite.command;
     redirectors->n_to_start = Config.Program.url_rewrite.children;
-    redirectors->ipc_type = IPC_TCP_SOCKET;
+    redirectors->ipc_type = IPC_STREAM;
     helperOpenServers(redirectors);
     if (!init) {
 	cachemgrRegister("url_rewriter",
Index: squid/src/unlinkd.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/unlinkd.c,v
retrieving revision 1.5
retrieving revision 1.5.48.1
diff -u -r1.5 -r1.5.48.1
--- squid/src/unlinkd.c	23 Feb 2001 21:03:31 -0000	1.5
+++ squid/src/unlinkd.c	26 Aug 2001 20:28:24 -0000	1.5.48.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: unlinkd.c,v 1.5 2001/02/23 21:03:31 hno Exp $
+ * $Id: unlinkd.c,v 1.5.48.1 2001/08/26 20:28:24 hno Exp $
  *
  * DEBUG: section 12    Unlink Daemon
  * AUTHOR: Duane Wessels
@@ -163,12 +163,7 @@
     struct timeval slp;
     args[0] = "(unlinkd)";
     args[1] = NULL;
-#if HAVE_POLL && defined(_SQUID_OSF_)
-    /* pipes and poll() don't get along on DUNIX -DW */
-    x = ipcCreate(IPC_TCP_SOCKET,
-#else
-    x = ipcCreate(IPC_FIFO,
-#endif
+    x = ipcCreate(IPC_STREAM,
 	Config.Program.unlinkd,
 	args,
 	"unlinkd",
Index: squid/src/auth/basic/auth_basic.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/auth_basic.c,v
retrieving revision 1.12
retrieving revision 1.12.6.1
diff -u -r1.12 -r1.12.6.1
--- squid/src/auth/basic/auth_basic.c	12 Aug 2001 15:20:28 -0000	1.12
+++ squid/src/auth/basic/auth_basic.c	26 Aug 2001 20:28:24 -0000	1.12.6.1
@@ -539,7 +539,7 @@
 	    basicauthenticators = helperCreate("basicauthenticator");
 	basicauthenticators->cmdline = basicConfig->authenticate;
 	basicauthenticators->n_to_start = basicConfig->authenticateChildren;
-	basicauthenticators->ipc_type = IPC_TCP_SOCKET;
+	basicauthenticators->ipc_type = IPC_STREAM;
 	helperOpenServers(basicauthenticators);
 	if (!init) {
 	    cachemgrRegister("basicauthenticator",
Index: squid/src/auth/ntlm/auth_ntlm.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/auth_ntlm.c,v
retrieving revision 1.11
retrieving revision 1.11.6.1
diff -u -r1.11 -r1.11.6.1
--- squid/src/auth/ntlm/auth_ntlm.c	12 Aug 2001 15:20:28 -0000	1.11
+++ squid/src/auth/ntlm/auth_ntlm.c	26 Aug 2001 20:28:24 -0000	1.11.6.1
@@ -258,7 +258,7 @@
 	assert(proxy_auth_cache);
 	ntlmauthenticators->cmdline = ntlmConfig->authenticate;
 	ntlmauthenticators->n_to_start = ntlmConfig->authenticateChildren;
-	ntlmauthenticators->ipc_type = IPC_TCP_SOCKET;
+	ntlmauthenticators->ipc_type = IPC_STREAM;
 	ntlmauthenticators->datapool = ntlm_helper_state_pool;
 	ntlmauthenticators->IsAvailable = authenticateNTLMHelperServerAvailable;
 	ntlmauthenticators->OnEmptyQueue = authenticateNTLMHelperServerOnEmpty;
