X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_error.c;h=561fbcffffb44cfe5a673ecb1dda083f135dfbc3;hb=refs%2Fheads%2Fupstream-ssl;hp=ffe19ff6e682a8fac873fce294ffac47a8e97f32;hpb=56f512008e81aeae915b2b7f6bcdd54b549188d3;p=ircu2.10.12-pk.git diff --git a/ircd/m_error.c b/ircd/m_error.c index ffe19ff..561fbcf 100644 --- a/ircd/m_error.c +++ b/ircd/m_error.c @@ -85,6 +85,7 @@ #include "hash.h" #include "ircd.h" #include "ircd_alloc.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" #include "numeric.h" @@ -93,9 +94,41 @@ #include "s_misc.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include +/* + * mr_error - unregistered client message handler + * + * parv[0] = sender prefix + * parv[parc-1] = text + */ +int mr_error(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + const char *para; + + if (!IsHandshake(cptr) && !IsConnecting(cptr)) + return 0; /* ignore ERROR from regular clients */ + + para = (parc > 1 && *parv[parc - 1] != '\0') ? parv[parc - 1] : "<>"; + + Debug((DEBUG_ERROR, "Received ERROR message from %s: %s", cli_name(sptr), para)); + + if (cptr == sptr) + sendto_opmask_butone(0, SNO_OLDSNO, "ERROR :from %C -- %s", cptr, para); + else + sendto_opmask_butone(0, SNO_OLDSNO, "ERROR :from %C via %C -- %s", sptr, + cptr, para); + + if (cli_serv(sptr)) + { + MyFree(cli_serv(sptr)->last_error_msg); + DupString(cli_serv(sptr)->last_error_msg, para); + } + + return 0; +} + /* * ms_error - server message handler *