]> jfr.im git - irc/quakenet/newserv.git/blobdiff - proxyscan/proxyscanhandlers.c
Merge.
[irc/quakenet/newserv.git] / proxyscan / proxyscanhandlers.c
index 0d784305b9c1c27c6759c5974aaa9288486943e3..23b32e8fde8480d592a08bc8b05dc53b87000d03 100644 (file)
@@ -15,18 +15,18 @@ void proxyscan_newnick(int hooknum, void *arg) {
   if (irc_in_addr_is_loopback(&np->p_ipaddr) || !irc_in_addr_is_ipv4(&np->p_ipaddr)) 
     return;
 
-  unsigned int ip = irc_in_addr_v4_to_int(&np->p_ipaddr);
-
   /* before we look at a normal host, see if we think we have an open proxy */
   if ((esp=findextrascan(np->ipnode))) {
     Error("proxyextra", ERR_ERROR, "connection from possible proxy %s", IPtostr(np->p_ipaddr)); 
     for (espp=esp;espp;espp=espp->nextbynode) { 
+      /* we force a scan on any hosts that may be an open proxy, even if they are:
+       * a) already in the queue, b) we've been running < 120 seconds */
       queuescan(np->ipnode, espp->type, espp->port, SCLASS_NORMAL, time(NULL));
     }
   }
 
-  /* ignore newnick for first 120s */
-  if (ps_start_ts+120 > time(NULL))
+  /* ignore newnick until initial burst complete */
+  if (!ps_ready)
     return;
 
   /*
@@ -42,7 +42,6 @@ void proxyscan_newnick(int hooknum, void *arg) {
    *
    * If they're not in the cache, we queue up their scans
    */
-
   if ((chp=findcachehost(np->ipnode))) {
     if (!chp->proxies)
       return;
@@ -70,15 +69,15 @@ void proxyscan_newnick(int hooknum, void *arg) {
     }
 
     /* set a SHORT gline - if they really have an open proxy the gline will be re-set, with a new ID */
-    irc_send("%s GL * +*@%s 600 :Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d",
-            mynumeric->content,IPtostr(np->p_ipaddr),chp->glineid);
+    irc_send("%s GL * +*@%s 600 %jd :Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d",
+            mynumeric->content,IPtostr(np->p_ipaddr),(intmax_t)getnettime(), chp->glineid);
 
     chp->lastscan=time(NULL);
     chp->proxies=NULL;
     chp->glineid=0;
   } else {
     chp=addcleanhost(time(NULL));
-    np->ipnode->slots[ps_cache_ext] = chp;
+    np->ipnode->exts[ps_cache_ext] = chp;
     patricia_ref_prefix(np->ipnode->prefix);
 
     /* Queue up all the normal scans - on the normal queue */
@@ -86,4 +85,3 @@ void proxyscan_newnick(int hooknum, void *arg) {
       queuescan(np->ipnode, thescans[i].type, thescans[i].port, SCLASS_NORMAL, 0);
   }
 }
-