]> jfr.im git - solanum.git/blobdiff - ircd/packet.c
Warn opers about unresponsive servers
[solanum.git] / ircd / packet.c
index 502d5344b979cb388626ec50ac06c4373a50da1c..f0350d5ead3d10f4f5d443ac5fb82b2c161c0888 100644 (file)
@@ -32,6 +32,7 @@
 #include "hook.h"
 #include "send.h"
 #include "s_assert.h"
+#include "s_newconf.h"
 
 static char readBuf[READBUF_SIZE];
 static void client_dopacket(struct Client *client_p, char *buffer, size_t length);
@@ -108,7 +109,7 @@ parse_client_queued(struct Client *client_p)
                /* allow opers 4 times the amount of messages as users. why 4?
                 * why not. :) --fl_
                 */
-               if(IsOper(client_p) && ConfigFileEntry.no_oper_flood)
+               if(IsOperGeneral(client_p) && ConfigFileEntry.no_oper_flood)
                        allow_read *= 4;
                /*
                 * Handle flood protection here - if we exceed our flood limit on
@@ -271,6 +272,23 @@ read_packet(rb_fde_t * F, void *data)
                        client_p->localClient->lasttime = rb_current_time();
                client_p->flags &= ~FLAGS_PINGSENT;
 
+               if (client_p->flags & FLAGS_PINGWARN)
+               {
+                       /*
+                        * if we warned about this server being unresponsive
+                        * before, let's let everyone know there's no need
+                        * to panic
+                        */
+                       client_p->flags &= ~FLAGS_PINGWARN;
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
+                               "Received response from previously unresponsive link %s",
+                               client_p->name);
+                       ilog(L_SERVER,
+                               "Received response from previously unresponsive link %s",
+                               log_client_name(client_p, HIDE_IP));
+               }
+
+
                /*
                 * Before we even think of parsing what we just read, stick
                 * it on the end of the receive queue and do it when its
@@ -294,7 +312,7 @@ read_packet(rb_fde_t * F, void *data)
                if(!IsAnyServer(client_p) &&
                   (rb_linebuf_alloclen(&client_p->localClient->buf_recvq) > ConfigFileEntry.client_flood_max_lines))
                {
-                       if(!(ConfigFileEntry.no_oper_flood && IsOper(client_p)))
+                       if(!(ConfigFileEntry.no_oper_flood && IsOperGeneral(client_p)))
                        {
                                exit_client(client_p, client_p, client_p, "Excess Flood");
                                return;
@@ -321,7 +339,7 @@ read_packet(rb_fde_t * F, void *data)
  *      with client_p of "local" variation, which contains all the
  *      necessary fields (buffer etc..)
  */
-void
+static void
 client_dopacket(struct Client *client_p, char *buffer, size_t length)
 {
        s_assert(client_p != NULL);