From fa7b9810d09152a1e6adf16d9d8bad7a037e307f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 10 Feb 2026 12:30:25 +0000 Subject: Debug instructions for the smtproutes converter --- src/qmail-remote/smtproutes.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/qmail-remote/smtproutes.c b/src/qmail-remote/smtproutes.c index 7fcfada..1aac915 100644 --- a/src/qmail-remote/smtproutes.c +++ b/src/qmail-remote/smtproutes.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "qmailr.h" @@ -127,6 +128,12 @@ static inline void smtproutes_compile (int fdr, int fdw) { char c = getnext(&b) ; uint16_t val = table[state][cclass(c)] ; + LOLDEBUG("state %hhu, char %c, newstate %hu, actions %s%s%s%s%s", state, c, val & 0x000f, + val & 0x0100 ? "n" : "", + val & 0x0200 ? "h" : "", + val & 0x0400 ? "r" : "", + val & 0x0800 ? "p" : "", + val & 0x1000 ? "a" : "") ; state = val & 0x000f ; if (val & 0x0100) { @@ -151,9 +158,12 @@ static inline void smtproutes_compile (int fdr, int fdw) } if (val & 0x0100) { - if (relaypos > 1 || relayend > 2 + relaypos) + if (relaypos || relayend > 2 + relaypos) + { + LOLDEBUG("adding entry: %.*s -> %.*s", (int)relaypos, sa.s, (int)(relayend - relaypos), sa.s + relaypos) ; if (!cdbmake_add(&cm, sa.s, relaypos, sa.s + relaypos, relayend - relaypos)) qmailr_tempusys("cdbmake_add") ; + } sa.len = 0 ; } } -- cgit v1.3.1