]> jfr.im git - irc/ircd-hybrid/bopm.git/commitdiff
scan.c:
authorandy <redacted>
Sun, 10 Feb 2002 15:25:59 +0000 (15:25 +0000)
committerandy <redacted>
Sun, 10 Feb 2002 15:25:59 +0000 (15:25 +0000)
Improved HTTP handling.  Seems to work (have tested against all
known HTTP false positives seen so far, plus 2 known open proxies).
Ideas and pseudocode from jpayne@blitzed.org.

scan.c

diff --git a/scan.c b/scan.c
index b5adcf8a8c5cac5e12222c8f4ce73ff876e18ad3..35ec8be3013c45353354c0dd8ebbba99817d8e9d 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -485,11 +485,17 @@ int scan_r_squid(struct scan_struct *ss)
            if((newline - RECVBUFF) >= strlen(RECVBUFF)) 
                 return 1;
 
-           if(!strncasecmp(newline, "Date:",5))  
-                return 0;
-                                                /* Apache hack: (apache sends HTTP/1.x 200
-                                                 * sometimes when it shouldn't. This code checks
-                                                 * for the second header apache should send.*/
+          if(newline[0] != ':' &&                              /* ircd message */
+            newline[0] != '\r' &&                             /* another newline */
+             strncasecmp(newline, "NOTICE",6) != 0 &&          /* hybrid ircd */
+             strncasecmp(newline, "Proxy-Type:",11) != 0) {    /* some open proxies */
+              if (OPT_DEBUG)
+               {
+                 log("SCAN -> Found a proxy/httpd which replied, but "
+                     "don't think it is open, got:\n%s\n", newline);
+               }
+               return 0;
+          }
 
            return 1;      /* Open Proxy */
        }