]> 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>
Tue, 8 Jul 2008 10:07:15 +0000 (12:07 +0200)
committerGuido Serassio <serassio@squid-cache.org>
Tue, 8 Jul 2008 10:07:15 +0000 (12:07 +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.

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

index 8f7a2ba942c20de39fb2c10c0f40738b53e3bc81..daae1f758d9be905fc3116f24db72737011a5ad9 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 f81bb65130a47287b6c0237dc590c58913681b68..5aec56248e5a3d03aeab5f3ccb3be14852511e57 100644 (file)
@@ -5478,4 +5478,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 3cdaa4a..f7901a8
@@ -554,6 +554,7 @@ struct _SquidConfig
         int httpd_suppress_version_string;
         int global_internal_static;
         int debug_override_X;
+        int WIN32_IpAddrChangeMonitor;
     }
 
     onoff;