From 339e175f44976837c73477477dbf5d721d705073 Mon Sep 17 00:00:00 2001 From: "certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sat, 15 Jul 2006 10:29:34 +0000 Subject: # BUILD : 1.7.14 (1089) # BUGS : 549 # NOTES : applied trystan's patch for the SJOIN issue. git-svn-id: svn://svn.anope.org/anope/trunk@1089 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@813 5417fbe8-f217-4b02-8779-1006273d7864 --- src/channels.c | 2 +- src/init.c | 2 ++ src/main.c | 1 + src/misc.c | 22 ++++++++++++++++++++++ src/process.c | 5 +++++ 5 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/channels.c b/src/channels.c index bce64bd4c..ca47792ad 100644 --- a/src/channels.c +++ b/src/channels.c @@ -747,7 +747,7 @@ void do_sjoin(const char *source, int ac, char **av) } /* Double check to avoid unknown modes that need parameters */ - if (ac >= 4 && ac <= 6) { + if (ac >= 4) { c = findchan(av[1]); if (ircd->chansqline) { if (!c) diff --git a/src/init.c b/src/init.c index e83cab176..748b6c054 100644 --- a/src/init.c +++ b/src/init.c @@ -323,6 +323,8 @@ static int parse_options(int ac, char **av) forceload = 1; } else if (strcmp(s, "nothird") == 0) { nothird = 1; + } else if (strcmp(s, "protocoldebug") == 0) { + protocoldebug = 1; } else if (strcmp(s, "support") == 0) { nofork = 1; debug++; diff --git a/src/main.c b/src/main.c index c3ed705db..524bf3a88 100644 --- a/src/main.c +++ b/src/main.c @@ -44,6 +44,7 @@ int nofork = 0; /* -nofork */ int forceload = 0; /* -forceload */ int nothird = 0; /* -nothrid */ int noexpire = 0; /* -noexpire */ +int protocoldebug = 0; /* -protocoldebug */ #ifdef USE_RDB int do_mysql = 0; /* use mysql ? */ diff --git a/src/misc.c b/src/misc.c index 855de4725..3592f7f65 100644 --- a/src/misc.c +++ b/src/misc.c @@ -751,6 +751,28 @@ char *myStrSubString(const char *src, int start, int end) /*************************************************************************/ +void protocol_debug(char *source, char *cmd, int argc, char **argv) +{ + int i; + + if (protocoldebug) { + if (source) + alog("debug: Source %s", source); + if (cmd) + alog("debug: Token %s", cmd); + if (argc) { + for (i = 0; i < argc; i++) { + alog("debug: av[%d] = %s", i, argv[i]); + } + } else { + alog("debug: av[0] = NULL"); + } + } + return; +} + +/*************************************************************************/ + /** * Clean up the buffer for extra spaces * @param str to clean up diff --git a/src/process.c b/src/process.c index 92dcc8931..f002d9f85 100644 --- a/src/process.c +++ b/src/process.c @@ -232,6 +232,11 @@ void process() s = buf + strlen(buf); strscpy(cmd, buf, sizeof(cmd)); ac = split_buf(s, &av, 1); + + if (protocoldebug) { + protocol_debug(source, cmd, ac, av); + } + if (mod_current_buffer) { free(mod_current_buffer); } -- cgit