Log message:
Finally tracked down why ERROR messages from servers we're connecting to
aren't being saved: there was no handler for ERRORs from unregistered
clients! Curiously enough, handlers.h had a declaration for one. Anyway,
I added one, with a test for IsUserPort() so that ordinary users can't
abuse us (I hope...), and it now works fine. Also removed an unused
variable found while trying to track down a bug that causes some servers
and users to not be sent in the BURST--I haven't yet tracked that bug down,
unfortunately.
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@546
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
+2001-07-31 Kevin L. Mitchell <klmitch@mit.edu>
+
+ * ircd/s_serv.c (server_estab): remove unused variable split
+
+ * ircd/parse.c: add mr_error to the parse table
+
+ * ircd/m_error.c (mr_error): add mr_error() to handle ERRORs from
+ unregistered connections--if IsUserPort() is true, the ERROR is
+ ignored, otherwise, the message is saved
+
2001-07-28 Kevin L. Mitchell <klmitch@mit.edu>
* ircd/m_kill.c (ms_kill): another minor typo *sigh*
#include <assert.h>
#include <string.h>
+/*
+ * 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 (IsUserPort(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
*
TOK_ERROR,
0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
/* UNREG, CLIENT, SERVER, OPER, SERVICE */
- { m_ignore, m_ignore, ms_error, m_ignore, m_ignore }
+ { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
},
{
MSG_KILL,
{
struct Client* acptr = 0;
const char* inpath;
- int split, i;
+ int i;
assert(0 != cptr);
assert(0 != cli_local(cptr));
- split = (0 != ircd_strcmp(cli_name(cptr), cli_sockhost(cptr))
- && 0 != ircd_strncmp(cli_info(cptr), "JUPE", 4));
inpath = cli_name(cptr);
if (IsUnknown(cptr)) {
if (0 == match(cli_name(&me), cli_name(acptr)))
continue;
- split = (MyConnect(acptr) &&
- 0 != ircd_strcmp(cli_name(acptr), cli_sockhost(acptr)) &&
- 0 != ircd_strncmp(cli_info(acptr), "JUPE", 4));
sendcmdto_one(cli_serv(acptr)->up, CMD_SERVER, cptr,
"%s %d 0 %Tu %s%u %s%s +%s%s :%s", cli_name(acptr),
cli_hopcount(acptr) + 1, cli_serv(acptr)->timestamp,