]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Windows Merges - dup2 and debugging.
authorrobertc <>
Sun, 31 Aug 2003 07:22:05 +0000 (07:22 +0000)
committerrobertc <>
Sun, 31 Aug 2003 07:22:05 +0000 (07:22 +0000)
Keywords:

These are 2 residual Windows port merge patches:

- main.cc: On Windows signal() can't be used for debugging purpose: added
support for native  debug
- comm.cc: On Windows dup2() can't work correctly on Sockets, the work
around is to close the destination socket before call them.

Regards

Guido

src/comm.cc
src/main.cc

index 3e0218503b5f808154ece2cf17663564e46f62c0..08cf8c7adeb5a173a4a9ed843a22255c5d79b0ce 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.387 2003/08/15 13:06:34 robertc Exp $
+ * $Id: comm.cc,v 1.388 2003/08/31 01:22:05 robertc Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1407,6 +1407,14 @@ commResetFD(ConnectStateData * cs)
         return 0;
     }
 
+#ifdef _SQUID_MSWIN_
+
+    /* On Windows dup2() can't work correctly on Sockets, the          */
+    /* workaround is to close the destination Socket before call them. */
+    close(cs->fd);
+
+#endif
+
     if (dup2(fd2, cs->fd) < 0) {
         debug(5, 0) ("commResetFD: dup2: %s\n", xstrerror());
 
index 8fe67f4dcba0318522d113a18ca8013e1297a3db..7e11240ddca264dbb6003f403ccb60ce936742d9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.386 2003/08/17 13:22:30 robertc Exp $
+ * $Id: main.cc,v 1.387 2003/08/31 01:22:05 robertc Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -1093,6 +1093,13 @@ main(int argc, char **argv)
         if (do_reconfigure) {
             mainReconfigure();
             do_reconfigure = 0;
+#if defined(_SQUID_MSWIN_) && defined(_DEBUG)
+
+        } else if (do_debug) {
+            do_debug = 0;
+            __asm int 3;
+#endif
+
         } else if (do_rotate) {
             mainRotate();
             do_rotate = 0;