]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Many small fixes uncovered by the testbed layer #02
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 30 Nov 2008 09:08:48 +0000 (02:08 -0700)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 30 Nov 2008 09:08:48 +0000 (02:08 -0700)
 - failover recovery for valgrind support
 - better error reporting and detection for epoll support
 - better dependency detection and handling for ESI support
 - ARP build error on FreeBSD
 - hack: silence build error on ZPH QoS support (TODO fix)

TODO:
 - fix ZPH support for BSD (Bug 2537)
 - comm symbol duplication failures under gcc 4.3.2

configure.in
include/config.h
src/ACLARP.cc
src/comm_epoll.cc
test-suite/buildtests/layer-02-maximus.opts

index bb4831e9c17654f2fd08b2834600e63ca52ea9be..571562aabe16afccef4fa5d55e89a25fd2484459 100644 (file)
@@ -764,7 +764,19 @@ AC_ARG_ENABLE(esi,
 if test "$use_esi" = "yes" ; then
   AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
   AM_CONDITIONAL(USE_ESI, true)
+
+  dnl Perform configuration consistency checks for ESI
+  dnl ESI support requires libexpat
+  AC_CHECK_LIB([expat], [main],
+        [ESI_LIBS="-lexpat"],
+        [AC_MSG_FAILURE([ESI support requires libexpat library, but no usable library was found])]
+  )
+  AC_CHECK_LIB([xml2], [main],
+        [ESI_LIBS="-lxml2"],
+        [AC_MSG_FAILURE([ESI support requires libxml2 library, but no usable library was found])]
+  )
   XTRA_LIBS="$XTRA_LIBS -lexpat -lxml2"
+
 else
   AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
 fi
@@ -1148,6 +1160,11 @@ AC_ARG_ENABLE(epoll,
   yes)
     echo "Forcing epoll() to be enabled"
     SELECT_TYPE="epoll"
+    dnl epoll requires header file and library to be installed
+    AC_CHECK_HEADERS([sys/epoll.h],[],
+      [ AC_MSG_ERROR([required sys/epoll.h header file is missing.]) ])
+    AC_CHECK_LIB(epoll, epoll_ctl, [],
+      [ AC_MSG_ERROR([required libepoll library is missing.]) ])
     ;;
   no)
     echo "Forcing epoll() to be disabled"
@@ -1155,7 +1172,40 @@ AC_ARG_ENABLE(epoll,
   ;;
 esac
 ])
+dnsl epoll requires sys/epoll.h and libepoll
+if test -z "$disable_epoll"; then
+  # Check for libepoll
+  EPOLL_LIB=
+  AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
+  AC_SUBST(EPOLL_LIBS)
+
+  # Check for epoll_ctl, may need -lepoll
+  SAVED_LIBS="$LIBS"
+  LIBS="$LIBS $LIB_EPOLL"
+  AC_CHECK_FUNCS(epoll_ctl)
+  LIBS="$SAVED_LIBS"
+
+  AC_CHECK_HEADERS([sys/epoll.h])
 
+  dnl Verify that epoll really works
+  if test $ac_cv_func_epoll_ctl = yes; then
+    AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
+      AC_TRY_RUN([
+#include <sys/epoll.h>
+#include <stdlib.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+    int fd = epoll_create(256);
+    if (fd < 0) {
+       perror("epoll_create:");
+       exit(1);
+    }
+    exit(0);
+}
+      ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
+  fi
+fi
 
 dnl Disable HTTP violations
 http_violations=1
@@ -1758,8 +1808,11 @@ AC_ARG_WITH(valgrind-debug,
        ;;
   esac
   if test $valgrind; then
-       AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
-       echo "Valgrind debug support enabled"
+    AC_CHECK_HEADERS(valgrind/memcheck.h,
+      [ AC_DEFINE(WITH_VALGRIND, 1, [Valgrind memory debugger support])
+       echo "Valgrind debug support enabled" ],
+      [ echo "Valgrind header not found. Valgrind support disabled." ]
+    )
   fi
 ])
 
@@ -2892,36 +2945,6 @@ LIBS="$LIBS $CRYPTLIB"
 AC_CHECK_FUNCS(crypt)
 LIBS="$SAVED_LIBS"
 
-# Check for libepoll
-EPOLL_LIB=
-AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"])
-AC_SUBST(EPOLL_LIBS)
-
-# Check for epoll_ctl, may need -lepoll
-SAVED_LIBS="$LIBS"
-LIBS="$LIBS $LIB_EPOLL"
-AC_CHECK_FUNCS(epoll_ctl)
-LIBS="$SAVED_LIBS"
-
-dnl Verify that epoll really works
-if test $ac_cv_func_epoll_ctl = yes; then
-  AC_CACHE_CHECK(if epoll works, ac_cv_epoll_works,
-    AC_TRY_RUN([
-#include <sys/epoll.h>
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv)
-{
-    int fd = epoll_create(256);
-    if (fd < 0) {
-       perror("epoll_create:");
-       exit(1);
-    }
-    exit(0);
-}
-    ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no]))
-fi
-
 dnl Magic which checks whether we are forcing a type of comm loop we
 dnl are actually going to (ab)use
  
index 7b0e6527df86a1cc86fc263f14f4fd3922251f14..10cc21c9bac72433bb52a592655d38d7179f9b69 100644 (file)
@@ -440,15 +440,16 @@ typedef union {
  */
 #if WITH_VALGRIND
 #include <valgrind/memcheck.h>
-#undef VALGRIND_MAKE_NOACCESS
-#undef VALGRIND_MAKE_WRITABLE
-#undef VALGRIND_MAKE_READABLE
 /* A little glue for older valgrind version prior to 3.2.0 */
 #ifndef VALGRIND_MAKE_MEM_NOACCESS
 #define VALGRIND_MAKE_MEM_NOACCESS VALGRIND_MAKE_NOACCESS
 #define VALGRIND_MAKE_MEM_UNDEFINED VALGRIND_MAKE_WRITABLE
 #define VALGRIND_MAKE_MEM_DEFINED VALGRIND_MAKE_READABLE
 #define VALGRIND_CHECK_MEM_IS_ADDRESSABLE VALGRIND_CHECK_WRITABLE
+#else
+#undef VALGRIND_MAKE_NOACCESS
+#undef VALGRIND_MAKE_WRITABLE
+#undef VALGRIND_MAKE_READABLE
 #endif
 #else
 #define VALGRIND_MAKE_MEM_NOACCESS(a,b) (0)
index 32b749b6c20de76ce50682a3a8aac9a09cf3782b..1e395911286f72061d81aa494ccd9c3743e7a174 100644 (file)
@@ -459,7 +459,8 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IPAddress &c)
 
     memset(&arpReq, '\0', sizeof(arpReq));
 
-    ipAddr.GetSockAddr(arpReq.arp_pa);
+    sa = (struct sockaddr_in*) &arpReq.arp_pa;
+    ipAddr.GetSockAddr(*sa);
 
     /* Query ARP table */
     mib[0] = CTL_NET;
index 949fe8fc401cd159960a716e1133efa165712215..c0ce625d95ed30fb55ab782002f7486aa03f694c 100644 (file)
@@ -63,7 +63,9 @@
 
 #define DEBUG_EPOLL 0
 
+#if HAVE_SYS_EPOLL_H
 #include <sys/epoll.h>
+#endif
 
 static int kdpfd;
 static int max_poll_time = 1000;
index 04a6b27d510265270114f606502221a5696d60c4..ae2428820f1fde4f260ec75bdbaa765ec9ce65f8 100644 (file)
 #      We can't test them automatically everywhere
 #
 #   --enable-ecap \
+#   --enable-epoll \
+#   --enable-esi \
 #   --enable-win32-service \
 #   --with-localhost-ipv6 \
 #
+#      AYJ: these features have known bugs. They are optional so we don't block on them...
+#      We can't test them automatically everywhere
+#
+#      --enable-zph-qos \
+#
 OPTS=" \
        --enable-loadable-modules \
        --enable-gnuregex \
@@ -43,7 +50,6 @@ OPTS=" \
        --enable-removal-policies \
        --enable-icmp \
        --enable-delay-pools \
-       --enable-esi \
        --enable-icap-client \
        --enable-useragent-log \
        --enable-referer-log \
@@ -60,7 +66,6 @@ OPTS=" \
        --enable-poll \
        --enable-select \
        --enable-kqueue \
-       --enable-epoll \
        --enable-http-violations \
        --enable-ipfw-transparent \
        --enable-ipf-transparent \
@@ -85,7 +90,6 @@ OPTS=" \
        --enable-cpu-profiling \
        --enable-vary \
        --enable-ipv6 \
-       --enable-zph-qos \
        --enable-auto-locale \
  \
        --with-aio \