Browse code

"Cache-Control: no-cache" is now disabled by default

git-svn: trunk@2212

Tomasz Kojm authored on 2006/08/26 04:51:09
Showing 5 changed files
... ...
@@ -1,3 +1,9 @@
1
+Fri Aug 25 21:23:59 CEST 2006 (tk)
2
+----------------------------------
3
+  * freshclam/manager.c: "Cache-Control: no-cache" is now disabled by default.
4
+			 If you're behind a broken proxy you can recompile
5
+			 freshclam with --enable-no-cache.
6
+
1 7
 Fri Aug 25 15:39:17 BST 2006 (njh)
2 8
 ----------------------------------
3 9
   * clamav-milter:	Tidy. Today's work seems to have removed the memory
... ...
@@ -84,6 +84,9 @@
84 84
 /* file i/o buffer size */
85 85
 #undef FILEBUFF
86 86
 
87
+/* use "Cache-Control: no-cache" in freshclam */
88
+#undef FRESHCLAM_NO_CACHE
89
+
87 90
 /* access rights in msghdr */
88 91
 #undef HAVE_ACCRIGHTS_IN_MSGHDR
89 92
 
... ...
@@ -1481,6 +1481,7 @@ Optional Features:
1481 1481
   --enable-yp-check	  use ypmatch utility instead of /etc/passwd parsing
1482 1482
   --disable-clamav	  disable test for clamav user/group
1483 1483
   --enable-debug	  enable debug code
1484
+  --enable-no-cache	  use "Cache-Control: no-cache" in freshclam
1484 1485
   --enable-experimental	enable experimental code
1485 1486
   --enable-bigstack	  increase thread stack size
1486 1487
   --disable-gethostbyname_r	  disable support for gethostbyname_r
... ...
@@ -5881,7 +5882,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5881 5881
 case $host in
5882 5882
 *-*-irix6*)
5883 5883
   # Find out which ABI we are using.
5884
-  echo '#line 5884 "configure"' > conftest.$ac_ext
5884
+  echo '#line 5885 "configure"' > conftest.$ac_ext
5885 5885
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5886 5886
   (eval $ac_compile) 2>&5
5887 5887
   ac_status=$?
... ...
@@ -6514,7 +6515,7 @@ chmod -w .
6514 6514
 save_CFLAGS="$CFLAGS"
6515 6515
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
6516 6516
 compiler_c_o=no
6517
-if { (eval echo configure:6517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
6517
+if { (eval echo configure:6518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
6518 6518
   # The compiler can only warn and ignore the option if not recognized
6519 6519
   # So say no if there are warnings
6520 6520
   if test -s out/conftest.err; then
... ...
@@ -8550,7 +8551,7 @@ else
8550 8550
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
8551 8551
   lt_status=$lt_dlunknown
8552 8552
   cat > conftest.$ac_ext <<EOF
8553
-#line 8553 "configure"
8553
+#line 8554 "configure"
8554 8554
 #include "confdefs.h"
8555 8555
 
8556 8556
 #if HAVE_DLFCN_H
... ...
@@ -8648,7 +8649,7 @@ else
8648 8648
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
8649 8649
   lt_status=$lt_dlunknown
8650 8650
   cat > conftest.$ac_ext <<EOF
8651
-#line 8651 "configure"
8651
+#line 8652 "configure"
8652 8652
 #include "confdefs.h"
8653 8653
 
8654 8654
 #if HAVE_DLFCN_H
... ...
@@ -13157,6 +13158,22 @@ _ACEOF
13157 13157
 
13158 13158
 fi
13159 13159
 
13160
+# Check whether --enable-no-cache was given.
13161
+if test "${enable_no_cache+set}" = set; then
13162
+  enableval=$enable_no_cache; enable_nocache=$enableval
13163
+else
13164
+  enable_nocache="no"
13165
+fi
13166
+
13167
+
13168
+if test "$enable_nocache" = "yes"; then
13169
+
13170
+cat >>confdefs.h <<\_ACEOF
13171
+#define FRESHCLAM_NO_CACHE 1
13172
+_ACEOF
13173
+
13174
+fi
13175
+
13160 13176
 # Check whether --enable-experimental was given.
13161 13177
 if test "${enable_experimental+set}" = set; then
13162 13178
   enableval=$enable_experimental; enable_experimental=$enableval
... ...
@@ -291,6 +291,14 @@ if test "$enable_debug" = "yes"; then
291 291
   AC_DEFINE(CL_DEBUG,1,[enable debugging])
292 292
 fi
293 293
 
294
+AC_ARG_ENABLE(no-cache,
295
+[  --enable-no-cache	  use "Cache-Control: no-cache" in freshclam],
296
+enable_nocache=$enableval, enable_nocache="no")
297
+
298
+if test "$enable_nocache" = "yes"; then
299
+  AC_DEFINE(FRESHCLAM_NO_CACHE,1,[use "Cache-Control: no-cache" in freshclam])
300
+fi
301
+
294 302
 AC_ARG_ENABLE(experimental,
295 303
 [  --enable-experimental	enable experimental code],
296 304
 enable_experimental=$enableval, enable_experimental="no")
... ...
@@ -467,7 +467,9 @@ static int getfile(const char *srcfile, const char *destfile, const char *hostna
467 467
 	"GET %s/%s HTTP/1.1\r\n"
468 468
 	"Host: %s\r\n%s"
469 469
 	"User-Agent: %s\r\n"
470
+#ifdef FRESHCLAM_NO_CACHE
470 471
 	"Cache-Control: no-cache\r\n"
472
+#endif
471 473
 	"Connection: close\r\n"
472 474
 	"\r\n", (remotename != NULL) ? remotename : "", srcfile, hostname, (authorization != NULL) ? authorization : "", agent);
473 475