summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.c2
-rw-r--r--src/init.c2
-rw-r--r--src/main.c1
-rw-r--r--src/misc.c22
-rw-r--r--src/process.c5
5 files changed, 31 insertions, 1 deletions
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);
}