--------------------- PatchSet 5884 Date: 2003/08/18 15:35:29 Author: serassio Branch: nt-2_5 Tag: (none) Log: Win32 IPC doesn't like synchronous sockets Members: src/ipc.c:1.7.10.11->1.7.10.12 Index: squid/src/ipc.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipc.c,v retrieving revision 1.7.10.11 retrieving revision 1.7.10.12 diff -u -r1.7.10.11 -r1.7.10.12 --- squid/src/ipc.c 11 Aug 2003 19:29:44 -0000 1.7.10.11 +++ squid/src/ipc.c 18 Aug 2003 15:35:29 -0000 1.7.10.12 @@ -1,6 +1,6 @@ /* - * $Id: ipc.c,v 1.7.10.11 2003/08/11 19:29:44 serassio Exp $ + * $Id: ipc.c,v 1.7.10.12 2003/08/18 15:35:29 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -36,6 +36,9 @@ #include "squid.h" #ifdef _SQUID_MSWIN_ +#ifndef _MSWSOCK_ +#include +#endif #include struct ipc_params @@ -95,6 +98,7 @@ #ifdef _SQUID_MSWIN_ unsigned long thread; struct ipc_params params; + int opt; #endif pid_t pid; struct sockaddr_in CS; @@ -127,6 +131,9 @@ *hIpc = NULL; if (ppid) *ppid = -1; + + opt = 0; + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, sizeof(opt)); #endif if (type == IPC_TCP_SOCKET) { crfd = cwfd = comm_open(SOCK_STREAM, @@ -184,6 +191,11 @@ debug(54, 3) ("ipcCreate: crfd FD %d\n", crfd); debug(54, 3) ("ipcCreate: cwfd FD %d\n", cwfd); +#ifdef _SQUID_MSWIN_ + opt = SO_SYNCHRONOUS_NONALERT; + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, sizeof(opt)); +#endif + if (crfd < 0) { debug(54, 0) ("ipcCreate: Failed to create child FD.\n"); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);