From: Francesco Chemolli Date: Tue, 22 Dec 2009 11:23:05 +0000 (+0100) Subject: Sanitized net I/O configuration X-Git-Tag: SQUID_3_2_0_1~310^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf53a520e648491e58204900b3cdf97fc1389b1e;p=thirdparty%2Fsquid.git Sanitized net I/O configuration --- diff --git a/configure.in b/configure.in index ce47ef5e2b..d014ea3d31 100644 --- a/configure.in +++ b/configure.in @@ -948,7 +948,6 @@ dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free]) dnl fi dnl ]) -dnl ****************** KK HERE ********************* AC_ARG_ENABLE(useragent-log, AS_HELP_STRING([--enable-useragent-log],[Enable logging of User-Agent header]), @@ -987,7 +986,7 @@ USE_WCCPv2=1 AC_ARG_ENABLE(wccpv2, AS_HELP_STRING([--disable-wccpv2],[Disable Web Cache Coordination V2 Protocol]), [ if test "$enableval" = "no" ; then - AC_MSG_NOTICE(["Web Cache Coordination V2 Protocol disabled"]) + AC_MSG_NOTICE([Web Cache Coordination V2 Protocol disabled]) USE_WCCPv2=0 fi ]) @@ -1180,85 +1179,82 @@ AC_ARG_WITH(coss-membuf-size, dnl check for netio plugin stuff dnl Enable poll() -disable_poll= +squid_opt_enable_poll=auto AC_ARG_ENABLE(poll, AS_HELP_STRING([--disable-poll],[Disable poll(2) support.]), [ case "$enableval" in yes) - AC_MSG_WARN([Forcing poll() to be enabled]) SELECT_TYPE="poll" + squid_opt_enable_poll=yes ;; no) - AC_MSG_WARN([Forcing poll() to be disabled]) - disable_poll=true + squid_opt_enable_poll=no ;; esac ]) +AC_MSG_NOTICE([enabling the use of poll() for net I/O: $squid_opt_enable_poll]) dnl Enable select() -disable_select= +squid_opt_enable_select=auto AC_ARG_ENABLE(select, AS_HELP_STRING([--disable-select],[Disable select(2) support.]), [ case "$enableval" in yes) - AC_MSG_WARN([Forcing select() to be enabled]) SELECT_TYPE="select" + squid_opt_enable_select=yes ;; no) - AC_MSG_WARN([Forcing select() to be disabled]) - disable_select=true + squid_opt_enable_select=no ;; esac ]) +AC_MSG_NOTICE([enabling the use of select() for net I/O: $squid_opt_enable_select]) dnl Enable kqueue() dnl kqueue support is still experiemntal and unstable. Not enabled by default. -disable_kqueue=true +squid_opt_enable_kqueue="no" AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[Enable kqueue(2) support (experimental).]), [ case "$enableval" in yes) - AC_MSG_WARN([Forcing kqueue() to be enabled]) SELECT_TYPE="kqueue" AC_CHECK_HEADERS([sys/event.h],[], [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ]) + squid_opt_enable_kqueue=yes ;; no) - AC_MSG_WARN([Forcing kqueue() to be disabled]) - disable_kqueue=true + squid_opt_enable_kqueue=no ;; - *) - AC_CHECK_HEADERS([sys/event.h]) - ;; -esac + esac ]) +AC_MSG_NOTICE([enabling the use of kqueue for net I/O: $squid_opt_enable_kqueue]) dnl Enable epoll() -disable_epoll= -force_epoll="no" +squid_opt_enable_epoll="auto" AC_ARG_ENABLE(epoll, AS_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), [ case "$enableval" in yes) - AC_MSG_WARN([Forcing epoll() to be enabled]) SELECT_TYPE="epoll" - force_epoll="yes" + squid_opt_enable_epoll="yes" ;; no) - AC_MSG_WARN([Forcing epoll() to be disabled]) - disable_epoll=true + squid_opt_enable_epoll="no" ;; esac ]) +AC_MSG_NOTICE([enabling the use of epoll for net I/O: $squid_opt_enable_epoll]) + +dnl ********************** KK HERE ************** dnl auto-detect and verify epoll header and library present and working -if test -z "$disable_epoll"; then +if test "$squid_opt_enable_epoll" != "no" ; then # Check for libepoll - EPOLL_LIB= + EPOLL_LIBS="" AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"]) AC_SUBST(EPOLL_LIBS) @@ -3331,27 +3327,22 @@ dnl Actually do the define magic now dnl mostly ripped from squid-commloops, thanks to adrian and benno if test -n "$SELECT_TYPE"; then - : # Already decided above. Nothing to do here -elif test -z "$disable_epoll" && test "$ac_cv_epoll_works" = "yes" ; then - SELECT_TYPE="epoll" -elif test -z "$disable_kqueue" && test "$ac_cv_func_kqueue" = "yes" ; then - SELECT_TYPE="kqueue" -elif test -z "$disable_poll" && test "$ac_cv_func_poll" = "yes" ; then - SELECT_TYPE="poll" -elif test -z "$disable_select" && test "$ac_cv_func_select" = "yes" ; then - case "$host_os" in - mingw|mingw32) - SELECT_TYPE="select_win32" - ;; - *) - SELECT_TYPE="select" - ;; - esac + AC_MSG_NOTICE([choosing user-specified net I/O API $SELECT_TYPE]) +elif test "$squid_opt_enable_epoll" != "no" && test "$ac_cv_epoll_works" = "yes" ; then + SELECT_TYPE="epoll" +elif test "$squid_opt_enable_kqueue" != "no" && test "$ac_cv_func_kqueue" = "yes" ; then + SELECT_TYPE="kqueue" +elif test "$squid_opt_enable_poll" != "no" && test "$ac_cv_func_poll" = "yes" ; then + SELECT_TYPE="poll" +elif test "$squid_opt_enable_select" != "no" && test "$ac_cv_func_select" = "yes" ; then + SELECT_TYPE="select" + if test "$squid_host_os" = "mingw" ; then + SELECT_TYPE="select_win32" + fi else - AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!]) - AC_MSG_WARN([I'll try select and hope for the best.]) - SELECT_TYPE="select" - AC_DEFINE(USE_SELECT,1) + AC_MSG_WARN([Eep! Can't find poll, kqueue, epoll, or select!]) + AC_MSG_WARN([I'll try select and hope for the best.]) + SELECT_TYPE="select" fi AC_MSG_NOTICE([Using ${SELECT_TYPE} for the IO loop.]) @@ -3365,25 +3356,13 @@ AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue]) AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll]) case $SELECT_TYPE in -epoll) - AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) - ;; -poll) - AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) - ;; -kqueue) - AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) - ;; -select_win32) - AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) - ;; -select) - AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) - ;; +epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;; +poll) AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop]) ;; +kqueue) AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop]) ;; +select_win32) AC_DEFINE(USE_SELECT_WIN32,1,[Use Winsock select() for the IO loop]) ;; +select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;; esac - - dnl Yay! Another Linux brokenness. Its not good enough dnl to know that setresuid() exists, because RedHat 5.0 declares dnl setresuid() but doesn't implement it.