Author: Isomer <isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / s_bsd.c
index 4d9be9e639f699c85fe85583fd00a9060a01ef24..d71037bfe5176fcb288fc34a3bd77733fd7d7574 100644 (file)
@@ -406,9 +406,9 @@ static int completed_connection(struct Client* cptr)
     sendto_opmask_butone(0, SNO_OLDSNO, "Lost Server Line for %s", cptr->name);
     return 0;
   }
-  /* XXX sendto_one sending without a prefix; be careful! */
+
   if (!EmptyString(aconf->passwd))
-    sendto_one(cptr, "PASS :%s", aconf->passwd);
+    sendrawto_one(cptr, MSG_PASS " :%s", aconf->passwd);
 
 #if 0 
   /* dead code, already done in connect_server */
@@ -434,10 +434,10 @@ static int completed_connection(struct Client* cptr)
    */
   cptr->lasttime = CurrentTime;
   cptr->flags |= FLAGS_PINGSENT;
-  /* XXX sendto_one sending without a prefix; be careful! */
-  sendto_one(cptr, "SERVER %s 1 " TIME_T_FMT " " TIME_T_FMT " J%s %s%s :%s",
-             me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, 
-             NumServCap(&me), me.info);
+
+  sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s",
+               me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, 
+               NumServCap(&me), me.info);
 
   return (IsDead(cptr)) ? 0 : 1;
 }
@@ -579,12 +579,23 @@ void add_connection(struct Listener* listener, int fd)
    * reject the user.
    */
   if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) {
-    ++ServerStats->is_ref;
+#ifdef IPCHECKDEBUG     
+   char buff[512];
+   snprintf(buff,"\n%s [%i connections active]\n",
+       throttle_message,
+       IPcheck_nr(addr.sin_addr));
+   buff[511]=0;
+   send(fd,buff,strlen(buff));
+#else
     /*
      * strlen(throttle_message) == 66
+     *
+     * strlen is slow, so we use the constant here.
      */
     send(fd, throttle_message, 66, 0);
+#endif
     close(fd);
+    ++ServerStats->is_ref;
     return;
   }