From: Guido Serassio Date: Mon, 30 Jun 2008 12:52:36 +0000 (+0200) Subject: Windows port: add option for control of IP address changes notification in squid... X-Git-Tag: SQUID_3_1_0_1~49^2~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6696974aff3783ecab673fb6265d6c9b92887b2;p=thirdparty%2Fsquid.git Windows port: add option for control of IP address changes notification in squid.conf 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 --- diff --git a/src/WinSvc.cc b/src/WinSvc.cc index 6fe9980043..15021b9f75 100755 --- a/src/WinSvc.cc +++ b/src/WinSvc.cc @@ -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) { diff --git a/src/cf.data.pre b/src/cf.data.pre index 039ce3ab41..2eced0f28f 100755 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/structs.h b/src/structs.h old mode 100644 new mode 100755 index 4a9d011b05..97b055e5d1 --- a/src/structs.h +++ b/src/structs.h @@ -476,6 +476,7 @@ struct SquidConfig int zph_tos_parent; int zph_preserve_miss_tos; #endif + int WIN32_IpAddrChangeMonitor; } onoff; class ACL *aclList;