--------------------- PatchSet 5881 Date: 2003/08/17 12:31:21 Author: serassio Branch: nt-2_5 Tag: (none) Log: Forced use of synchronous socket on Windows Members: src/win32.c:1.5.14.16->1.5.14.17 Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.5.14.16 retrieving revision 1.5.14.17 diff -u -r1.5.14.16 -r1.5.14.17 --- squid/src/win32.c 9 Feb 2003 19:22:45 -0000 1.5.14.16 +++ squid/src/win32.c 17 Aug 2003 12:31:21 -0000 1.5.14.17 @@ -47,6 +47,9 @@ #if HAVE_WIN32_PSAPI #include #endif +#ifndef _MSWSOCK_ +#include +#endif #include #endif @@ -420,7 +423,8 @@ } #endif #ifdef _SQUID_MSWIN_ - Win32SockInit(); + if (Win32SockInit() < 0) + return 1; #endif return 0; } @@ -792,7 +796,7 @@ { int iVersionRequested; WSADATA wsaData; - int err; + int err, opt; if (s_iInitCount > 0) { s_iInitCount++; @@ -813,6 +817,14 @@ WSACleanup(); return (s_iInitCount); } + + opt = SO_SYNCHRONOUS_NONALERT; + if (setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *) &opt, sizeof(opt))) { + s_iInitCount = -3; + WSACleanup(); + return (s_iInitCount); + } + WIN32_Socks_initialized = 1; s_iInitCount++; return (s_iInitCount);