diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-09 09:10:26 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2008-09-09 09:10:26 +0200 |
commit | c0dd0943168cdcac3efcb0744767eef241a11112 (patch) | |
tree | ee4473441a3032aa5e7d75643d597a204582a243 /debug.c | |
parent | ea27a882ce5b26967fc68c32970d61e77a15042c (diff) | |
download | dovecot-antispam-c0dd0943168cdcac3efcb0744767eef241a11112.tar.gz dovecot-antispam-c0dd0943168cdcac3efcb0744767eef241a11112.tar.xz dovecot-antispam-c0dd0943168cdcac3efcb0744767eef241a11112.zip |
some more verbose debugging, untested
Diffstat (limited to '')
-rw-r--r-- | debug.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -31,3 +31,34 @@ void debug(const char *fmt, ...) _debug(fmt, args); va_end(args); } + +void debugv(char **args) +{ + size_t len, pos, buflen = 1024; + char *buf; + const char *str; + + t_push(); + buf = t_buffer_get(buflen); + + while (1) { + str = *args; + if (!str) + break; + len = strlen(str); + if (pos + len + 1 >= buflen) { + buflen = nearest_power(pos + len + 2); + buf = t_buffer_reget(buf, buflen); + } + + memcpy(buf + pos, str, len); + pos += len; + buf[pos++] = ' '; + args++; + } + + buf[pos++] = '\0'; + + debug(stringify(PLUGINNAME) ": %s", buf); + t_pop(); +} |