]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows port: add option for control of IP address changes notification in squid...
authorGuido Serassio <serassio@squid-cache.org>
Mon, 30 Jun 2008 12:52:36 +0000 (14:52 +0200)
committerGuido Serassio <serassio@squid-cache.org>
Mon, 30 Jun 2008 12:52:36 +0000 (14:52 +0200)
On Windows Squid by default will monitor IP address changes and will
reconfigure itself after any detected event. This is very useful for
proxies connected to internet with dial-up interfaces.
In some cases (a Proxy server acting as VPN gateway is one) it could be
desiderable to disable this behaviour.

Also fixed build error on Cygwin

src/WinSvc.cc
src/cf.data.pre
src/structs.h [changed mode: 0644->0755]

index 6fe9980043ed7dd4a7db45ebd2b7135994a2007e..15021b9f75a6f25ec8c4889ca7fab078611f12cd 100755 (executable)
@@ -390,16 +390,18 @@ WIN32_Abort(int sig)
     WIN32_Exit();
 }
 
+#ifdef _SQUID_MSWIN_
 void
 WIN32_IpAddrChangeMonitorExit()
 {
     DWORD status = ERROR_SUCCESS;
 
-    if (NotifyAddrChange_thread == INVALID_HANDLE_VALUE) {
+    if (NotifyAddrChange_thread != INVALID_HANDLE_VALUE) {
        TerminateThread(NotifyAddrChange_thread, status);
        CloseHandle(NotifyAddrChange_thread);
     }
 }
+#endif
 
 void
 WIN32_Exit()
@@ -459,7 +461,7 @@ WIN32_IpAddrChangeMonitorInit()
     DWORD status = ERROR_SUCCESS;
     DWORD threadID = 0, ThrdParam = 0;
 
-    if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) {
+    if ((WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) && (Config.onoff.WIN32_IpAddrChangeMonitor)) {
        NotifyAddrChange_thread = CreateThread(NULL, 0, WIN32_IpAddrChangeMonitor,
            &ThrdParam, 0, &threadID);
        if (NotifyAddrChange_thread == NULL) {
index 039ce3ab415a5ab53c08c7a35d9eb576431e8c8f..2eced0f28fe0dee37b296ed25648df8e4d190548 100755 (executable)
@@ -5879,4 +5879,18 @@ DOC_START
        rounded to 1000.
 DOC_END
 
+NAME: windows_ipaddrchangemonitor
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: on
+LOC: Config.onoff.WIN32_IpAddrChangeMonitor
+DOC_START
+       On Windows Squid by default will monitor IP address changes and will 
+       reconfigure itself after any detected event. This is very useful for
+       proxies connected to internet with dial-up interfaces.
+       In some cases (a Proxy server acting as VPN gateway is one) it could be
+       desiderable to disable this behaviour setting this to 'off'.
+       Note: after changing this, Squid service must be restarted.
+DOC_END
+
 EOF
old mode 100644 (file)
new mode 100755 (executable)
index 4a9d011..97b055e
@@ -476,6 +476,7 @@ struct SquidConfig
         int zph_tos_parent;
         int zph_preserve_miss_tos;
 #endif
+        int WIN32_IpAddrChangeMonitor;
     } onoff;
 
     class ACL *aclList;