On Tuesday 19 October 2004 17:37, Jo Mills wrote:
> Hi,
>
> First let me apologize if this is way off the mark, but it has aroused
> my curiosity.  When you say "freshclam fails", do you get a return
> value of 1?  I only ask because we have two Web Proxies in the office,
> one is a Novell box and the other is Squid/Debian.  I built the
> Squid/Debian box as freshclam would not work through the Novell box
> and for various reasons too boring to go into here, it was just easier
> to re-route all non vpn traffic via a new proxy than get RSSI of the
> forehead negotiating with the IT dept - they control the Novell box.

If your problem is the same, there are two ways to solve.

1. Change Squid setting 
   Make squid not to use transfer coding.

  Accourding to http://www.imc.org/ietf-openproxy/mail-archive/msg02605.html
  > Note that HTTP/1.1 default is (identity, chunked).
  So, Squid also uses transfer encoding by default.
  # I couldn't find any document describes about that settings.

2 . Change freshclam to use HTTP/1.0
   I attached a simple patch changes freshclam to use HTTP/1.0

Quick check: 
You can check which your proxy uses transfer-encoding or not.

  $ telnet your.proxy.server 8080
  Connected to your.proxy.server (xxx.xxx.xxx.xxx).
  Escape character is '^]'.
  GET http://www.google.com/ HTTP/1.1

  HTTP/1.1 200 OK
  ..................
  ..................
  Transfer-Encoding: chunked

If your server uses transfer-encoding, you can see that header.

-- 
-- shivaken
antshell: Ant command line front end
http://www.antshell.org
diff -ur clamav-0.80/freshclam/manager.c clamav-0.80.new/freshclam/manager.c
--- clamav-0.80/freshclam/manager.c	2004-10-18 01:50:34.000000000 +0900
+++ clamav-0.80.new/freshclam/manager.c	2004-10-20 09:11:20.928348968 +0900
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 2002 - 2004 Tomasz Kojm <[EMAIL PROTECTED]>
- *  HTTP/1.1 compliance by Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
+ *  HTTP/1.0 compliance by Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
  *  Proxy support by Nigel Horne <[EMAIL PROTECTED]>
  *  Proxy authorization support by Gernot Tenchio <[EMAIL PROTECTED]>
  *		     (uses fmt_base64() from libowfat (http://www.fefe.de))
@@ -474,7 +474,7 @@
     mprintf("Reading CVD header (%s): ", file);
 
 #ifdef	NO_SNPRINTF
-    sprintf(cmd, "GET %s/%s HTTP/1.1\r\n"
+    sprintf(cmd, "GET %s/%s HTTP/1.0\r\n"
 	"Host: %s\r\n%s"
 	"User-Agent: "PACKAGE"/"VERSION"\r\n"
 	"Cache-Control: no-cache\r\n"
@@ -482,7 +482,7 @@
 	"Range: bytes=0-511\r\n"
 	"\r\n", (remotename != NULL)?remotename:"", file, hostname, (authorization != NULL)?authorization:"");
 #else
-    snprintf(cmd, sizeof(cmd), "GET %s/%s HTTP/1.1\r\n"
+    snprintf(cmd, sizeof(cmd), "GET %s/%s HTTP/1.0\r\n"
 	"Host: %s\r\n%s"
 	"User-Agent: "PACKAGE"/"VERSION"\r\n"
 	"Cache-Control: no-cache\r\n"
@@ -508,7 +508,7 @@
 	return NULL;
     }
 
-    if ((strstr(buffer, "HTTP/1.1 404")) != NULL) { 
+    if ((strstr(buffer, "HTTP/1.0 404")) != NULL) { 
       mprintf("@CVD file not found on remote server\n");
       return NULL;
     }
@@ -585,14 +585,14 @@
     }
 
 #ifdef NO_SNPRINTF
-    sprintf(cmd, "GET %s/%s HTTP/1.1\r\n"
+    sprintf(cmd, "GET %s/%s HTTP/1.0\r\n"
 	     "Host: %s\r\n%s"
 	     "User-Agent: "PACKAGE"/"VERSION"\r\n"
 	     "Cache-Control: no-cache\r\n"
 	     "Connection: close\r\n"
 	     "\r\n", (remotename != NULL)?remotename:"", dbfile, hostname, (authorization != NULL)?authorization:"");
 #else
-    snprintf(cmd, sizeof(cmd), "GET %s/%s HTTP/1.1\r\n"
+    snprintf(cmd, sizeof(cmd), "GET %s/%s HTTP/1.0\r\n"
 	     "Host: %s\r\n%s"
 	     "User-Agent: "PACKAGE"/"VERSION"\r\n"
 	     "Cache-Control: no-cache\r\n"
@@ -629,7 +629,7 @@
 
     /* check whether the resource actually existed or not */
 
-    if ((strstr(buffer, "HTTP/1.1 404")) != NULL) { 
+    if ((strstr(buffer, "HTTP/1.0 404")) != NULL) { 
       mprintf("@%s not found on remote server\n", dbfile);
       close(fd);
       unlink(file);
_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-users

Reply via email to