--------------------- PatchSet 1553 Date: 2005/08/21 07:20:28 Author: serassio Branch: nt Tag: (none) Log: Added Windows support for sleep_after_fork configuration directive Members: src/cf.data.pre:1.18.2.56->1.18.2.57 src/ipc.cc:1.8.2.17->1.8.2.18 Index: squid3/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cf.data.pre,v retrieving revision 1.18.2.56 retrieving revision 1.18.2.57 diff -u -r1.18.2.56 -r1.18.2.57 --- squid3/src/cf.data.pre 15 Aug 2005 19:51:03 -0000 1.18.2.56 +++ squid3/src/cf.data.pre 21 Aug 2005 07:20:28 -0000 1.18.2.57 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.18.2.56 2005/08/15 19:51:03 serassio Exp $ +# $Id: cf.data.pre,v 1.18.2.57 2005/08/21 07:20:28 serassio Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -4682,6 +4682,8 @@ processes, these sleep delays will add up and your Squid will not service requests for some amount of time until all the child processes have been started. + On Windows value less then 1000 (1 millisenconds) are + rounded to 1000. DOC_END NAME: minimum_expiry_time Index: squid3/src/ipc.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipc.cc,v retrieving revision 1.8.2.17 retrieving revision 1.8.2.18 diff -u -r1.8.2.17 -r1.8.2.18 --- squid3/src/ipc.cc 5 Jun 2005 12:58:49 -0000 1.8.2.17 +++ squid3/src/ipc.cc 21 Aug 2005 07:20:28 -0000 1.8.2.18 @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.8.2.17 2005/06/05 12:58:49 serassio Exp $ + * $Id: ipc.cc,v 1.8.2.18 2005/08/21 07:20:28 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -1395,18 +1395,24 @@ fd_table[result->childFD.rfd].flags.ipc = 1; fd_table[result->childFD.wfd].flags.ipc = 1; - { - DWORD ecode = 0; - - if (GetExitCodeThread(result->mySpawn->getHandle(), &ecode) && ecode == STILL_ACTIVE) { - result->result (IPCResult(true, pid, result->prfd, result->pwfd, HProcess)); - debugs(50, 1, "IPC::Create: Program: " << prog << ", PID: " << ", Handle: 0x" << HProcess); + if (Config.sleep_after_fork) { + /* XXX emulation of usleep() */ + DWORD sl; + sl = Config.sleep_after_fork / 1000; + if (sl == 0) + sl = 1; + Sleep(sl); + } + DWORD ecode = 0; + + if (GetExitCodeThread(result->mySpawn->getHandle(), &ecode) && ecode == STILL_ACTIVE) { + result->result (IPCResult(true, pid, result->prfd, result->pwfd, HProcess)); + debugs(50, 1, "IPC::Create: Program: " << prog << ", PID: " << ", Handle: 0x" << HProcess); - return result; - } else { - result->cleanUp(); - return result; - } + return result; + } else { + result->cleanUp(); + return result; } #else