Hi,

I thought I'd mention that I'm suffering the same behaviour.

I found it quite easy to reproduce as follows:

* on an IP and port that the proxy is allowed to query, run something
that listens on that IP/port and accepts an HTTP request, but closes the
connection immediately, eg.:

  $ echo | nc -l -v -p 80


* perform an HTTP request to that IP/port via the Squid proxy;  in my
case the proxy runs in transparent mode, and the port listen was running
on 192.168.0.9:80, so I did as follows:

  $ telnet localhost 3128
  Trying 127.0.0.1...
  Connected to interlock.pyro.eu.org.
  Escape character is '^]'.
  GET / HTTP/1.1
  Host: 192.168.0.9
  <blank line>


Attached is a patch I'm testing, which I based on the Squid developers'
commit 9082 mentioned previously.  With the patch applied, the proxy
quite appropriately returns a 503 Service Unavailable instead of
crashing (albeit with an error message claiming 'Connection Refused',
which isn't strictly true, because the connection is accepted and the
HTTP request definitely sent before the connection closes).

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org
diff -Nru squid3-3.0.STABLE8.orig/src/HttpMsg.cc 
squid3-3.0.STABLE8/src/HttpMsg.cc
--- squid3-3.0.STABLE8.orig/src/HttpMsg.cc      2009-08-05 03:34:44.000000000 
+0100
+++ squid3-3.0.STABLE8/src/HttpMsg.cc   2009-08-05 03:58:50.000000000 +0100
@@ -155,7 +155,11 @@
     // sanity check the start line to see if this is in fact an HTTP message
     if (!sanityCheckStartLine(buf, hdr_len, error)) {
         debugs(58,1, HERE << "first line of HTTP message is invalid");
-        // NP: sanityCheck sets *error
+        // NP: sanityCheck sets *error and sends debug warnings on syntax 
errors.
+        // if we have seen the connection close, this is an error too
+        if (eof && *error==HTTP_STATUS_NONE)
+            *error = HTTP_INVALID_HEADER;
+
         return false;
     }
 

Reply via email to