Convert listeners to use a flagset in preparation for IPv4/IPv6 selection.
[ircu2.10.12-pk.git] / ircd / s_bsd.c
index b076c0ec36f50387c59c7a1973959fb0e0bc30ac..71706e518536ee58478860c4cac23cf851cffd57 100644 (file)
@@ -132,13 +132,7 @@ void report_error(const char* text, const char* who, int err)
   if (EmptyString(who))
     who = "unknown";
 
-  if (last_notice + 20 < CurrentTime) {
-    /*
-     * pace error messages so opers don't get flooded by transients
-     */
-    sendto_opmask_butone(0, SNO_OLDSNO, text, who, errmsg);
-    last_notice = CurrentTime;
-  }
+  sendto_opmask_butone_ratelimited(0, SNO_OLDSNO, &last_notice, text, who, errmsg);
   log_write(LS_SOCKET, L_ERROR, 0, text, who, errmsg);
   errno = errtmp;
 }
@@ -499,7 +493,7 @@ void add_connection(struct Listener* listener, int fd) {
    */
   os_disable_options(fd);
 
-  if (listener->server)
+  if (listener_server(listener))
   {
     new_client = make_client(0, STAT_UNKNOWN_SERVER);
   }