]> jfr.im git - solanum.git/blobdiff - ircd/parse.c
Update NUMERIC_STR_435 to be more human-readable and mention quiets
[solanum.git] / ircd / parse.c
index e09dbe38ec9ffff89cf3e4ac78e6a5853daf37b4..bef6be15e37581d75344b74648a11f23ee27d312 100644 (file)
@@ -1,11 +1,11 @@
 /*
- *  charybdis: an advanced ircd.
+ *  Solanum: a slightly advanced ircd
  *  parse.c: The message parser.
  *
  *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
  *  Copyright (C) 1996-2002 Hybrid Development Team
  *  Copyright (C) 2002-2005 ircd-ratbox development team
- *  Copyright (C) 2007-2016 William Pitcock
+ *  Copyright (C) 2007-2016 Ariadne Conill <ariadne@dereferenced.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -82,8 +82,9 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
        struct Message *mptr;
        struct MsgBuf msgbuf;
 
-       s_assert(MyConnect(client_p));
-       s_assert(client_p->localClient->F != NULL);
+       s_assert(MyConnect(client_p) &&
+                       (client_p->localClient->F != NULL ||
+                               client_p->localClient->localflags & LFLAGS_FAKE));
        if(IsAnyDead(client_p))
                return;
 
@@ -144,8 +145,6 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                        ServerStats.is_unco++;
                        return;
                }
-
-               mptr->bytes += msgbuf.parselen;
        }
 
        if(mptr == NULL)
@@ -224,7 +223,7 @@ handle_command(struct Message *mptr, struct MsgBuf *msgbuf_p, struct Client *cli
                                return (-1);
                }
 
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                     "Dropping server %s due to (invalid) command '%s'"
                                     " with only %zu arguments (expecting %zu).",
                                     client_p->name, mptr->cmd, msgbuf_p->n_para, ehandler.min_para);
@@ -295,8 +294,11 @@ mod_add_cmd(struct Message *msg)
        if(msg == NULL)
                return;
 
-       if (rb_dictionary_find(cmd_dict, msg->cmd) != NULL)
+       if (rb_dictionary_find(cmd_dict, msg->cmd) != NULL) {
+               ilog(L_MAIN, "Add command: %s already exists", msg->cmd);
+               s_assert(0);
                return;
+       }
 
        msg->count = 0;
        msg->rcount = 0;
@@ -318,7 +320,10 @@ mod_del_cmd(struct Message *msg)
        if(msg == NULL)
                return;
 
-       rb_dictionary_delete(cmd_dict, msg->cmd);
+       if (rb_dictionary_delete(cmd_dict, msg->cmd) == NULL) {
+               ilog(L_MAIN, "Delete command: %s not found", msg->cmd);
+               s_assert(0);
+       }
 }
 
 /* cancel_clients()
@@ -375,7 +380,7 @@ remove_unknown(struct Client *client_p, const char *lsender, char *lbuffer)
        if((IsDigit(lsender[0]) && slen == 3) ||
           (strchr(lsender, '.') != NULL))
        {
-               sendto_realops_snomask(SNO_DEBUG, L_ALL,
+               sendto_realops_snomask(SNO_DEBUG, L_NETWIDE,
                                     "Unknown prefix (%s) from %s, Squitting %s",
                                     lbuffer, client_p->name, lsender);
 
@@ -387,7 +392,7 @@ remove_unknown(struct Client *client_p, const char *lsender, char *lbuffer)
        else if(!IsDigit(lsender[0]))
                ;
        else if(slen != 9)
-               sendto_realops_snomask(SNO_DEBUG, L_ALL,
+               sendto_realops_snomask(SNO_DEBUG, L_NETWIDE,
                                     "Invalid prefix (%s) from %s",
                                     lbuffer, client_p->name);
        else
@@ -476,7 +481,7 @@ do_numeric(int numeric, struct Client *client_p, struct Client *source_p, int pa
                         */
                        if(numeric != ERR_NOSUCHNICK &&
                           numeric != ERR_NOSUCHSERVER)
-                               sendto_realops_snomask(SNO_GENERAL, L_ADMIN,
+                               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                                     "*** %s(via %s) sent a %03d numeric to me: %s",
                                                     source_p->name,
                                                     client_p->name, numeric, buffer);
@@ -515,6 +520,9 @@ m_not_oper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
 void
 m_unregistered(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
+       if(IsAnyServer(client_p))
+               return;
+
        /* bit of a hack.
         * I don't =really= want to waste a bit in a flag
         * number_of_nick_changes is only really valid after the client