]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Merge windows fixes.
authorrobertc <>
Sun, 20 Apr 2003 11:28:58 +0000 (11:28 +0000)
committerrobertc <>
Sun, 20 Apr 2003 11:28:58 +0000 (11:28 +0000)
Keywords:

Patches applied:

  * robertc@squid-cache.org--squid/squid--windows--3.0--patch-5
     Make netdb always use binary mode for files.

  * robertc@squid-cache.org--squid/squid--windows--3.0--patch-4
     More windows native support work from Guido.

  * robertc@squid-cache.org--squid/squid--windows--3.0--patch-3
     Merge from HEAD.

Summary: Italian ESI translation from Guido Serassio.
Keywords:

Italian ESI translation from Guido Serassio.

errors/Italian/ERR_ESI
src/client_side_reply.cc
src/comm.cc
src/defines.h
src/globals.h
src/main.cc
src/net_db.cc
src/protos.h
src/squid.h
src/tools.cc

index b78db43c91a48d19779b5edd394813da0ac03d3f..4ee590bae956a4ba65835138263a32440b9b4f48 100644 (file)
@@ -1,29 +1,28 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <HTML><HEAD>
-<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
+<TITLE>ERRORE: La URL richiesta non pu&ograve; essere recuperata</TITLE>
 <STYLE type="text/css"><!--BODY{background-color:#ffffff; font-family:verdana,sans-serif}--></STYLE>
 </HEAD><BODY>
-<H2>The requested URL could not be retrieved</H2>
+<H2>La URL richiesta non pu&ograve; essere recuperata</H2>
 <HR noshade size="1px">
 <P>
-While trying to retrieve the URL:
+Mentre si cercava di recuperare la URL:
 <A HREF="%U">%U</A>
 <P>
-The following error was encountered:
+&Egrave; avvenuto il seguente errore:
 <BLOCKQUOTE>
-ESI Processing failed.
+Elaborazione ESI fallita.
 </BLOCKQUOTE>
 
 <P>
-The ESI processor returned:
+Il processore ESI ha risposto:
 <BLOCKQUOTE>
 %Z
 </BLOCKQUOTE>
 
 <P>
-This means that:
+Ci&ograve; significa che:
 <PRE>
- The surrogate was not able to process the ESI template. Please report this error to the webmaster. 
+ Il "surrogate" server non ha potuto elaborare la template ESI. Si prega di segnalare questo errore al webmaster.
 </PRE>
-<P>Your webmaster is <A HREF="mailto:%w">%w</A>.</P>
-<P>This page is in english because a translation has not been made. If you are able to, please create a translation and contact the squid project to get it included.</P>
+<P>Il vostro webmaster &egrave; <A HREF="mailto:%w">%w</A>.</P>
index 14ab1db8b00e9c48e2057d41145cbbd93b13d308..e44c5c3ff6dcd99e9efd71f6121ca5c1e19c5c15 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.48 2003/04/06 08:23:10 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.49 2003/04/20 05:28:58 robertc Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -143,7 +143,8 @@ clientReplyContext::operator new (size_t byteCount)
 void
 clientReplyContext::operator delete (void *address)
 {
-    cbdataFree (address);
+    clientReplyContext * tmp = (clientReplyContext *)address;
+    cbdataFree (tmp);
 }
 
 void
index 99c42c76c66494e95142952bf7b79fca28025603..044b82f3115c540a7cd8c05f6fc86aae6509ebb7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.372 2003/03/10 04:56:37 robertc Exp $
+ * $Id: comm.cc,v 1.373 2003/04/20 05:28:58 robertc Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1186,7 +1186,12 @@ comm_openex(int sock_type,
 
     if (port > (u_short) 0)
     {
-        commSetNoLinger(new_socket);
+#ifdef _SQUID_MSWIN_
+
+        if (sock_type != SOCK_DGRAM)
+#endif
+
+            commSetNoLinger(new_socket);
 
         if (opt_reuseaddr)
             commSetReuseAddr(new_socket);
@@ -1952,19 +1957,22 @@ commSetTcpRcvbuf(int fd, int size)
 int
 commSetNonBlocking(int fd)
 {
+#ifndef _SQUID_MSWIN_
     int flags;
     int dummy = 0;
-#ifdef _SQUID_CYGWIN_
+#endif
+#if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_)
 
     int nonblocking = TRUE;
 
     if (fd_table[fd].type != FD_PIPE) {
         if (ioctl(fd, FIONBIO, &nonblocking) < 0) {
-            debug(50, 0) ("commSetNonBlocking: FD %d: %s %D\n", fd, xstrerror(), fd_table[fd].type);
+            debug(50, 0) ("commSetNonBlocking: FD %d: %s %d\n", fd, xstrerror(), fd_table[fd].type);
             return COMM_ERROR;
         }
     } else {
 #endif
+#ifndef _SQUID_MSWIN_
 
         if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
             debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
@@ -1976,7 +1984,8 @@ commSetNonBlocking(int fd)
             return COMM_ERROR;
         }
 
-#ifdef _SQUID_CYGWIN_
+#endif
+#if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_)
 
     }
 
@@ -1989,6 +1998,11 @@ commSetNonBlocking(int fd)
 int
 commUnsetNonBlocking(int fd)
 {
+#ifdef _SQUID_MSWIN_
+    int nonblocking = FALSE;
+
+    if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) {
+#else
     int flags;
     int dummy = 0;
 
@@ -1998,6 +2012,7 @@ commUnsetNonBlocking(int fd)
     }
 
     if (fcntl(fd, F_SETFL, flags & (~SQUID_NONBLOCK)) < 0) {
+#endif
         debug(50, 0) ("commUnsetNonBlocking: FD %d: %s\n", fd, xstrerror());
         return COMM_ERROR;
     }
@@ -2007,8 +2022,7 @@ commUnsetNonBlocking(int fd)
 }
 
 void
-commSetCloseOnExec(int fd)
-{
+commSetCloseOnExec(int fd) {
 #ifdef FD_CLOEXEC
     int flags;
     int dummy = 0;
@@ -2028,8 +2042,7 @@ commSetCloseOnExec(int fd)
 
 #ifdef TCP_NODELAY
 static void
-commSetTcpNoDelay(int fd)
-{
+commSetTcpNoDelay(int fd) {
     int on = 1;
 
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0)
@@ -2042,8 +2055,7 @@ commSetTcpNoDelay(int fd)
 
 
 void
-comm_init(void)
-{
+comm_init(void) {
     fd_table =(fde *) xcalloc(Squid_MaxFD, sizeof(fde));
     fdd_table = (fd_debug_t *)xcalloc(Squid_MaxFD, sizeof(fd_debug_t));
     fdc_table = new fdc_t[Squid_MaxFD];
@@ -2066,8 +2078,7 @@ comm_init(void)
 
 /* Write to FD. */
 static void
-commHandleWrite(int fd, void *data)
-{
+commHandleWrite(int fd, void *data) {
     CommWriteStateData *state = (CommWriteStateData *)data;
     int len = 0;
     int nleft;
@@ -2138,8 +2149,7 @@ commHandleWrite(int fd, void *data)
  * free_func is used to free the passed buffer when the write has completed.
  */
 void
-comm_old_write(int fd, const char *buf, int size, CWCB * handler, void *handler_data, FREE * free_func)
-{
+comm_old_write(int fd, const char *buf, int size, CWCB * handler, void *handler_data, FREE * free_func) {
     CommWriteStateData *state = fd_table[fd].rwstate;
 
     assert(!fd_table[fd].flags.closing);
@@ -2165,8 +2175,7 @@ comm_old_write(int fd, const char *buf, int size, CWCB * handler, void *handler_
 
 /* a wrapper around comm_write to allow for MemBuf to be comm_written in a snap */
 void
-comm_old_write_mbuf(int fd, MemBuf mb, CWCB * handler, void *handler_data)
-{
+comm_old_write_mbuf(int fd, MemBuf mb, CWCB * handler, void *handler_data) {
     comm_old_write(fd, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb));
 }
 
@@ -2176,8 +2185,7 @@ comm_old_write_mbuf(int fd, MemBuf mb, CWCB * handler, void *handler_data)
  * like to use it.
  */
 int
-ignoreErrno(int ierrno)
-{
+ignoreErrno(int ierrno) {
     switch (ierrno) {
 
     case EINPROGRESS:
@@ -2206,8 +2214,7 @@ ignoreErrno(int ierrno)
 }
 
 void
-commCloseAllSockets(void)
-{
+commCloseAllSockets(void) {
     int fd;
     fde *F = NULL;
 
@@ -2240,8 +2247,7 @@ commCloseAllSockets(void)
 }
 
 static bool
-AlreadyTimedOut(fde *F)
-{
+AlreadyTimedOut(fde *F) {
     if (!F->flags.open)
         return true;
 
@@ -2255,8 +2261,7 @@ AlreadyTimedOut(fde *F)
 }
 
 void
-checkTimeouts(void)
-{
+checkTimeouts(void) {
     int fd;
     fde *F = NULL;
     PF *callback;
@@ -2289,8 +2294,7 @@ checkTimeouts(void)
  * accept()ed.
  */
 int
-comm_listen(int sock)
-{
+comm_listen(int sock) {
     int x;
 
     if ((x = listen(sock, Squid_MaxFD >> 2)) < 0) {
@@ -2304,20 +2308,17 @@ comm_listen(int sock)
 }
 
 void
-fdc_t::beginAccepting()
-{
+fdc_t::beginAccepting() {
     accept.accept.beginAccepting();
 }
 
 int
-fdc_t::acceptCount() const
-{
+fdc_t::acceptCount() const {
     return accept.accept.acceptCount();
 }
 
 void
-fdc_t::acceptOne(int fd)
-{
+fdc_t::acceptOne(int fd) {
     /* If we're out of fds, register an event and return now */
 
     if (fdNFree() < RESERVED_FD) {
@@ -2359,20 +2360,17 @@ fdc_t::acceptOne(int fd)
 }
 
 bool
-AcceptFD::finished() const
-{
+AcceptFD::finished() const {
     return finished_;
 }
 
 void
-AcceptFD::finished(bool newValue)
-{
+AcceptFD::finished(bool newValue) {
     finished_ = newValue;
 }
 
 bool
-AcceptFD::finishedAccepting() const
-{
+AcceptFD::finishedAccepting() const {
     return acceptCount() >= MAX_ACCEPT_PER_LOOP || finished();
 }
 
@@ -2381,8 +2379,7 @@ AcceptFD::finishedAccepting() const
  * to dupe itself and fob off an accept()ed connection
  */
 static void
-comm_accept_try(int fd, void *data)
-{
+comm_accept_try(int fd, void *data) {
     assert(fdc_table[fd].active == 1);
 
     fdc_table[fd].beginAccepting();
@@ -2397,8 +2394,7 @@ comm_accept_try(int fd, void *data)
  *   this isn't very optimal and should be revisited at a later date.
  */
 void
-comm_accept(int fd, IOACB *handler, void *handler_data)
-{
+comm_accept(int fd, IOACB *handler, void *handler_data) {
     fdc_t *Fc;
 
     assert(fd_table[fd].flags.open == 1);
@@ -2421,8 +2417,7 @@ comm_accept(int fd, IOACB *handler, void *handler_data)
 #endif
 }
 
-void CommIO::Initialise()
-{
+void CommIO::Initialise() {
     /* Initialize done pipe signal */
     int DonePipe[2];
     pipe(DonePipe);
@@ -2442,22 +2437,19 @@ int CommIO::DoneFD = -1;
 int CommIO::DoneReadFD = -1;
 
 void
-CommIO::FlushPipe()
-{
+CommIO::FlushPipe() {
     char buf[256];
     read(DoneReadFD, buf, sizeof(buf));
 }
 
 void
-CommIO::NULLFDHandler(int fd, void *data)
-{
+CommIO::NULLFDHandler(int fd, void *data) {
     FlushPipe();
     commSetSelect(fd, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
 }
 
 void
-CommIO::ResetNotifications()
-{
+CommIO::ResetNotifications() {
     if (DoneSignalled) {
         FlushPipe();
         DoneSignalled = false;
@@ -2466,14 +2458,12 @@ CommIO::ResetNotifications()
 
 AcceptLimiter AcceptLimiter::Instance_;
 
-AcceptLimiter &AcceptLimiter::Instance()
-{
+AcceptLimiter &AcceptLimiter::Instance() {
     return Instance_;
 }
 
 void
-AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data)
-{
+AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data) {
     Acceptor temp;
     temp.theFunction = aFunc;
     temp.acceptFD = fd;
@@ -2482,8 +2472,7 @@ AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data)
 }
 
 void
-AcceptLimiter::kick()
-{
+AcceptLimiter::kick() {
     if (!deferred.size())
         return;
 
@@ -2496,8 +2485,7 @@ AcceptLimiter::kick()
 }
 
 void
-commMarkHalfClosed(int fd)
-{
+commMarkHalfClosed(int fd) {
     assert (fdc_table[fd].active && !fdc_table[fd].half_closed);
     AbortChecker::Instance().monitor(fd);
     fdc_table[fd].half_closed = true;
@@ -2508,8 +2496,7 @@ AbortChecker &AbortChecker::Instance() {return Instance_;}
 AbortChecker AbortChecker::Instance_;
 
 void
-AbortChecker::AbortCheckReader(int fd, char *, size_t size, comm_err_t flag, int xerrno, void *data)
-{
+AbortChecker::AbortCheckReader(int fd, char *, size_t size, comm_err_t flag, int xerrno, void *data) {
     assert (size == 0);
     /* sketch:
      * if the read is ok and 0, the conn is still open.
@@ -2523,8 +2510,7 @@ AbortChecker::AbortCheckReader(int fd, char *, size_t size, comm_err_t flag, int
 }
 
 void
-AbortChecker::monitor(int fd)
-{
+AbortChecker::monitor(int fd) {
     assert (!contains(fd));
 
     add
@@ -2534,8 +2520,7 @@ AbortChecker::monitor(int fd)
 }
 
 void
-AbortChecker::stopMonitoring (int fd)
-{
+AbortChecker::stopMonitoring (int fd) {
     assert (contains (fd));
 
     remove
@@ -2546,8 +2531,7 @@ AbortChecker::stopMonitoring (int fd)
 
 #include "splay.h"
 void
-AbortChecker::doIOLoop()
-{
+AbortChecker::doIOLoop() {
     if (checking) {
         /*
         fds->walk(RemoveCheck, this);
@@ -2567,29 +2551,25 @@ AbortChecker::doIOLoop()
 }
 
 void
-AbortChecker::AddCheck (int const &fd, void *data)
-{
+AbortChecker::AddCheck (int const &fd, void *data) {
     AbortChecker *me = (AbortChecker *)data;
     me->addCheck(fd);
 }
 
 void
-AbortChecker::RemoveCheck (int const &fd, void *data)
-{
+AbortChecker::RemoveCheck (int const &fd, void *data) {
     AbortChecker *me = (AbortChecker *)data;
     me->removeCheck(fd);
 }
 
 
 int
-AbortChecker::IntCompare (int const &lhs, int const &rhs)
-{
+AbortChecker::IntCompare (int const &lhs, int const &rhs) {
     return lhs - rhs;
 }
 
 bool
-AbortChecker::contains (int const fd) const
-{
+AbortChecker::contains (int const fd) const {
     fds = fds->splay(fd, IntCompare);
 
     if (splayLastResult != 0)
@@ -2601,8 +2581,7 @@ AbortChecker::contains (int const fd) const
 void
 
 AbortChecker::remove
-    (int const fd)
-{
+    (int const fd) {
 
     fds = fds->remove
           (fd, IntCompare);
@@ -2611,56 +2590,46 @@ AbortChecker::remove
 void
 
 AbortChecker::add
-    (int const fd)
-{
+    (int const fd) {
     fds = fds->insert (fd, IntCompare);
 }
 
 void
-AbortChecker::addCheck (int const fd)
-{
+AbortChecker::addCheck (int const fd) {
     /* assert comm_is_open (fd); */
     comm_read(fd, NULL, 0, AbortCheckReader, NULL);
 }
 
 void
-AbortChecker::removeCheck (int const fd)
-{
+AbortChecker::removeCheck (int const fd) {
     /*
       comm_read_cancel(fd, AbortCheckReader, NULL);
     */
 }
 
-CommRead::CommRead() : fd(-1), buf(NULL), len(0)
-{}
+CommRead::CommRead() : fd(-1), buf(NULL), len(0) {}
 
 CommRead::CommRead(int fd_, char *buf_, int len_, IOCB *handler_, void *data_)
-        : fd(fd_), buf(buf_), len(len_), callback(handler_, data_)
-{}
+        : fd(fd_), buf(buf_), len(len_), callback(handler_, data_) {}
 
-DeferredRead::DeferredRead () : theReader(NULL), theContext(NULL), theRead(), cancelled(false)
-{}
+DeferredRead::DeferredRead () : theReader(NULL), theContext(NULL), theRead(), cancelled(false) {}
 
-DeferredRead::DeferredRead (DeferrableRead *aReader, void *data, CommRead const &aRead) : theReader(aReader), theContext (data), theRead(aRead), cancelled(false)
-{}
+DeferredRead::DeferredRead (DeferrableRead *aReader, void *data, CommRead const &aRead) : theReader(aReader), theContext (data), theRead(aRead), cancelled(false) {}
 
-DeferredReadManager::~DeferredReadManager()
-{
+DeferredReadManager::~DeferredReadManager() {
     flushReads();
     assert (deferredReads.empty());
 }
 
 void
-DeferredReadManager::delayRead(DeferredRead const &aRead)
-{
+DeferredReadManager::delayRead(DeferredRead const &aRead) {
     debug (5, 3)("Adding deferred read on fd %d\n", aRead.theRead.fd);
     List<DeferredRead> *temp = deferredReads.push_back(aRead);
     comm_add_close_handler (aRead.theRead.fd, CloseHandler, temp);
 }
 
 void
-DeferredReadManager::CloseHandler(int fd, void *thecbdata)
-{
+DeferredReadManager::CloseHandler(int fd, void *thecbdata) {
     if (!cbdataReferenceValid (thecbdata))
         return;
 
@@ -2670,8 +2639,7 @@ DeferredReadManager::CloseHandler(int fd, void *thecbdata)
 }
 
 DeferredRead
-DeferredReadManager::popHead(ListContainer<DeferredRead> &deferredReads)
-{
+DeferredReadManager::popHead(ListContainer<DeferredRead> &deferredReads) {
     assert (!deferredReads.empty());
 
     if (!deferredReads.head->element.cancelled)
@@ -2683,8 +2651,7 @@ DeferredReadManager::popHead(ListContainer<DeferredRead> &deferredReads)
 }
 
 void
-DeferredReadManager::kickReads(int const count)
-{
+DeferredReadManager::kickReads(int const count) {
     /* if we had List::size() we could consolidate this and flushReads */
 
     if (count < 1) {
@@ -2704,8 +2671,7 @@ DeferredReadManager::kickReads(int const count)
 }
 
 void
-DeferredReadManager::flushReads()
-{
+DeferredReadManager::flushReads() {
     ListContainer<DeferredRead> reads;
     reads = deferredReads;
     deferredReads = ListContainer<DeferredRead>();
@@ -2717,8 +2683,7 @@ DeferredReadManager::flushReads()
 }
 
 void
-DeferredReadManager::kickARead(DeferredRead const &aRead)
-{
+DeferredReadManager::kickARead(DeferredRead const &aRead) {
     if (aRead.cancelled)
         return;
 
@@ -2728,13 +2693,11 @@ DeferredReadManager::kickARead(DeferredRead const &aRead)
 }
 
 void
-DeferredRead::markCancelled()
-{
+DeferredRead::markCancelled() {
     cancelled = true;
 }
 
-ConnectionDetail::ConnectionDetail()
-{
+ConnectionDetail::ConnectionDetail() {
     bzero(&me, sizeof(me));
     bzero(&peer, sizeof(peer));
 }
index 0eda5eb49ed0c2fe3c76b313fab2e0dda85500f7..4e21e71b83ff2d143a1b1171c59e21b71dd65d89 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: defines.h,v 1.112 2003/01/23 00:37:19 robertc Exp $
+ * $Id: defines.h,v 1.113 2003/04/20 05:28:58 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
 #endif
 
 #define        HTTP_REQBUF_SZ  4096
+
+/* CygWin & Windows NT Port */
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
+#define _WIN_SQUID_SERVICE_CONTROL_STOP SERVICE_CONTROL_STOP
+#define _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_SHUTDOWN
+#define _WIN_SQUID_SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_INTERROGATE
+#define _WIN_SQUID_SERVICE_CONTROL_ROTATE      128
+#define _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE 129
+#define _WIN_SQUID_SERVICE_CONTROL_DEBUG       130
+#define _WIN_SQUID_SERVICE_CONTROL_INTERRUPT   131
+#define _WIN_SQUID_DEFAULT_SERVICE_NAME                "SquidNT"
+#define _WIN_SQUID_SERVICE_OPTION              "--ntservice"
+#define _WIN_SQUID_RUN_MODE_INTERACTIVE                0
+#define _WIN_SQUID_RUN_MODE_SERVICE            1
+#endif
+
 #endif /* SQUID_DEFINES_H */
index 4f079896df9516b3e676a727a03b9c4110e6b72f..81efa158c457086d038fdd8255f02aae2f193728 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.121 2003/02/25 12:22:34 robertc Exp $
+ * $Id: globals.h,v 1.122 2003/04/20 05:28:58 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -157,9 +157,19 @@ extern ssize_t store_maxobjsize;   /* -1 */
 extern RemovalPolicy *mem_policy;
 extern hash_table *proxy_auth_username_cache;  /* NULL */
 extern int incoming_sockets_accepted;
+#ifdef _SQUID_MSWIN_
+extern unsigned int WIN32_Socks_initialized;   /* 0 */
+#endif
 #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
 extern unsigned int WIN32_OS_version;  /* 0 */
-extern char *WIN32_OS_string;  /* NULL */
+extern char *WIN32_OS_string;           /* NULL */
+extern char *WIN32_Service_name;        /* NULL */
+extern char *WIN32_Command_Line;        /* NULL */
+extern char *WIN32_Service_Command_Line; /* NULL */
+extern unsigned int WIN32_run_mode;     /* _WIN_SQUID_RUN_MODE_INTERACTIVE */
+#if defined(_SQUID_MSWIN_) && defined(_DEBUG)
+extern int do_debug;                   /* 0 */
+#endif
 #endif
 #if HAVE_SBRK
 extern void *sbrk_start;       /* 0 */
index e101ee0cc08b63eba453728d60bfcad0cf50b60a..c62df3cfacb3c5bc68ca69c5e51b8612d448ca17 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.369 2003/02/25 12:24:35 robertc Exp $
+ * $Id: main.cc,v 1.370 2003/04/20 05:28:58 robertc Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -306,10 +306,12 @@ static void
 rotate_logs(int sig)
 {
     do_rotate = 1;
+#ifndef _SQUID_MSWIN_
 #if !HAVE_SIGACTION
 
     signal(sig, rotate_logs);
 #endif
+#endif
 }
 
 /* ARGSUSED */
@@ -317,16 +319,19 @@ static void
 reconfigure(int sig)
 {
     do_reconfigure = 1;
+#ifndef _SQUID_MSWIN_
 #if !HAVE_SIGACTION
 
     signal(sig, reconfigure);
 #endif
+#endif
 }
 
 void
 shut_down(int sig)
 {
     do_shutdown = sig == SIGINT ? -1 : 1;
+#ifndef _SQUID_MSWIN_
 #ifdef KILL_PARENT_OPT
 
     if (getppid() > 1) {
@@ -342,6 +347,7 @@ shut_down(int sig)
 
     signal(SIGINT, SIG_DFL);
 
+#endif
 #endif
 }
 
@@ -1001,6 +1007,7 @@ sendSignal(void)
     exit(0);
 }
 
+#ifndef _SQUID_MSWIN_
 /*
  * This function is run when Squid is in daemon mode, just
  * before the parent forks and starts up the child process.
@@ -1043,6 +1050,8 @@ mainStartScript(const char *prog)
     }
 }
 
+#endif /* _SQUID_MSWIN_ */
+
 static int
 checkRunningPid(void)
 {
@@ -1064,6 +1073,7 @@ checkRunningPid(void)
 static void
 watch_child(char *argv[])
 {
+#ifndef _SQUID_MSWIN_
     char *prog;
     int failcount = 0;
     time_t start;
@@ -1200,6 +1210,7 @@ watch_child(char *argv[])
     }
 
     /* NOTREACHED */
+#endif /* _SQUID_MSWIN_ */
 }
 
 static void
index d197831f5026cada32d56c7c5a6b1ccf11d03ecd..226cf990173c08f6aef91c5c1127caf18b403e11 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.170 2003/03/06 11:51:56 robertc Exp $
+ * $Id: net_db.cc,v 1.171 2003/04/20 05:28:59 robertc Exp $
  *
  * DEBUG: section 38    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -528,7 +528,7 @@ netdbReloadState(void)
      * Solaris bugs, its a bad idea.  fopen can fail if more than
      * 256 FDs are open.
      */
-    fd = file_open(path, O_RDONLY | O_TEXT);
+    fd = file_open(path, O_RDONLY | O_BINARY);
 
     if (fd < 0)
         return;
index 643994e453b39bbe95bafc2dfd87fc6ed21769e6..1a4519f082016b2c1868179389673b7aba887ce4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.474 2003/03/15 04:17:39 robertc Exp $
+ * $Id: protos.h,v 1.475 2003/04/20 05:28:59 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1068,8 +1068,21 @@ SQUIDCEXTERN int varyEvaluateMatch(StoreEntry * entry, request_t * req);
 /* CygWin & Windows NT Port */
 /* win32.c */
 #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
+#ifdef USE_WIN32_SERVICE
+SQUIDCEXTERN int WIN32_Subsystem_Init(int *, char ***);
+#else
 SQUIDCEXTERN int WIN32_Subsystem_Init(void);
+#endif
+SQUIDCEXTERN void WIN32_sendSignal(int);
+SQUIDCEXTERN void WIN32_Abort(int);
 SQUIDCEXTERN void WIN32_Exit(void);
+SQUIDCEXTERN void WIN32_SetServiceCommandLine(void);
+SQUIDCEXTERN void WIN32_InstallService(void);
+SQUIDCEXTERN void WIN32_RemoveService(void);
+#endif
+#ifdef _SQUID_MSWIN_
+
+SQUIDCEXTERN int WIN32_getrusage(int, struct rusage *);
 #endif
 
 /* external_acl.c */
index 720a3633f18072a03560055a31b3ccab06dbc4af..abc6bf1bc4bff54e42f8512da0dab8643be150fd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.232 2003/03/10 04:56:38 robertc Exp $
+ * $Id: squid.h,v 1.233 2003/04/20 05:29:00 robertc Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -368,6 +368,7 @@ extern "C"
 
 template<class A>
 inline A const &
+#ifndef min
 min(A const & lhs, A const & rhs)
 {
     if (rhs < lhs)
@@ -376,7 +377,10 @@ min(A const & lhs, A const & rhs)
     return lhs;
 }
 
+#endif
+
 #define XMIN(x,y) (min (x,y))
+#ifndef max
 template<class A>
 inline A const &
 max(A const & lhs, A const & rhs)
@@ -387,6 +391,8 @@ max(A const & lhs, A const & rhs)
     return lhs;
 }
 
+#endif
+
 #define XMAX(a,b) (max (a,b))
 
 /*
index 6babb3dc14528091e4b16042913bc2277f1d07bc..94db68d3355f2da532807aa3f2f4587d55ff3caf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.233 2003/02/21 22:50:12 robertc Exp $
+ * $Id: tools.cc,v 1.234 2003/04/20 05:29:00 robertc Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -375,6 +375,11 @@ death(int sig)
 void
 sigusr2_handle(int sig)
 {
+#if defined(_SQUID_MSWIN_) && defined(_DEBUG)
+    do_debug = 1;
+#endif
+#if (defined(_SQUID_MSWIN_) && !defined(_DEBUG)) || !defined(_SQUID_MSWIN_)
+
     static int state = 0;
     /* no debug() here; bad things happen if the signal is delivered during _db_print() */
 
@@ -398,6 +403,7 @@ sigusr2_handle(int sig)
         state = 0;
     }
 
+#endif
 #if !HAVE_SIGACTION
     signal(sig, sigusr2_handle);       /* reinstall */
 
@@ -502,6 +508,7 @@ debug_trap(const char *message) {
 
 void
 sig_child(int sig) {
+#ifndef _SQUID_MSWIN_
 #ifdef _SQUID_NEXT_
     union wait status;
 #else
@@ -532,6 +539,7 @@ sig_child(int sig) {
         ;
     signal(sig, sig_child);
 
+#endif
 #endif
 }