[pfx-dev] [PATCH] pipemap, unionmap: Fix refcount leak in error path

2025-06-13 Thread Richard Hansen via Postfix-devel
If the loop that registers the underlying tables detected an invalid table spec (missing colon), it would free the partially constructed pipemap or unionmap but not unregister any underlying tables that were registered during previous iterations of the loop. This would cause their refcount increme

[pfx-dev] Re: [PATCH] New "debug:" table/dict/map/db type for logging table accesses

2025-06-07 Thread Richard Hansen via Postfix-devel
On 2025-06-08 00:13:45-04:00, Viktor Dukhovni via Postfix-devel wrote: On Sat, Jun 07, 2025 at 07:49:42PM -0400, Richard Hansen via Postfix-devel wrote: This reuses the existing proxy object created by the dict_debug() function. Would it make sense to make the "debug" more config

[pfx-dev] [PATCH v2] New "debug:" table/dict/map/db type for logging table accesses

2025-06-08 Thread Richard Hansen via Postfix-devel
This reuses the existing proxy object created by the dict_debug() function. --- Changes from v1: * Don't inherit type and name from the underlying DICT; instead set type to "debug" and name to the registered name. This avoids the need for a new char * member in the DICT_DEBUG struct, at

[pfx-dev] [PATCH v4] New "debug:" table/dict/map/db type for logging table accesses

2025-06-09 Thread Richard Hansen via Postfix-devel
This reuses the existing proxy object created by the dict_debug() function. --- On 2025-06-09 12:35:47-04:00, Wietse Venema wrote: > Richard Hansen via Postfix-devel: >> I left a TODO comment in the second patch questioning whether >> $db:$name tables inside unionmap: and pipem

[pfx-dev] [PATCH] Fix missing #include statements

2025-06-11 Thread Richard Hansen via Postfix-devel
argv.h references ssize_t. vstream.h references WAIT_STATUS_T. --- A technique I use to ensure that every header is self-contained is to always have a corresponding .c for each .h (even if otherwise unnecessary, e.g., macro-only headers), and include the corresponding .h before including anything

[pfx-dev] [PATCH] unionmap: Also insert a comma for leading empty results

2025-06-11 Thread Richard Hansen via Postfix-devel
Before this change, a comma would be inserted if and only if the string to return to the caller was already non-empty. This caused an unfortunate asymmetry: * Underlying tables that returned a found but empty result *before* any underlying tables that returned a found and non-empty result

[pfx-dev] [PATCH] New "debug:" table/dict/map/db type for logging table accesses

2025-06-07 Thread Richard Hansen via Postfix-devel
This reuses the existing proxy object created by the dict_debug() function. --- proto/DATABASE_README.html | 13 +++ src/postconf/postconf.c | 9 + src/proxymap/Makefile.in | 1 + src/proxymap/proxymap.c | 2 ++ src/util/Makefile.in | 12 +-- src/util/dict_de

[pfx-dev] [PATCH v3 0/2] New "debug:" table/dict/map/db type for logging table accesses

2025-06-08 Thread Richard Hansen via Postfix-devel
On 2025-06-08 16:16:59-04:00, Wietse Venema via Postfix-devel wrote: > - postconf_dbms.c needs to be updated to skip leading debug: prefixes > just like proxy: prefixes. The purpose of that module is to > inspect database-specific config files (LDAP, SQL, etc.), and > to complain about mista

[pfx-dev] [PATCH v3 1/2] postconf: Revamp table variable tests for readability, coverage

2025-06-08 Thread Richard Hansen via Postfix-devel
I found the test28 and test29 tests difficult to understand, and they seemed to not provide the intended coverage. Rewrite them for clarity and completeness. --- src/postconf/Makefile.in | 40 + src/postconf/test28-main.cf | 22 ++ src/postconf/test28-ma

[pfx-dev] [PATCH v3 2/2] New "debug:" table/dict/map/db type for logging table accesses

2025-06-08 Thread Richard Hansen via Postfix-devel
This reuses the existing proxy object created by the dict_debug() function. --- proto/DATABASE_README.html | 13 +++ src/postconf/Makefile.in | 1 + src/postconf/postconf.c | 10 + src/postconf/postconf_dbms.c | 12 -- src/postconf/test28-main.cf | 12 ++ src/postconf/

[pfx-dev] Re: [PATCH] Fix missing #include statements

2025-06-11 Thread Richard Hansen via Postfix-devel
On 2025-06-11 22:51:38-04:00, Wietse Venema via Postfix-devel wrote: Wietse Venema via Postfix-devel: Richard Hansen via Postfix-devel: argv.h references ssize_t. vstream.h references WAIT_STATUS_T. --- A technique I use to ensure that every header is self-contained is to always have a

[pfx-dev] pipemap lookup implementation question

2025-06-11 Thread Richard Hansen via Postfix-devel
Hi all, I'm trying to understand the implementation of the pipemap: lookup function dict_pipe_lookup() [1]. Currently it copies the input query and pipeline stage outputs to a scratch buffer, and passes the buffer as the query for the next stage (or returns the buffer if there are no more st

[pfx-dev] Re: [PATCH] unionmap: Also insert a comma for leading empty results

2025-06-11 Thread Richard Hansen via Postfix-devel
On 2025-06-11 22:26:43-04:00, Wietse Venema via Postfix-devel wrote: An empty lookup result is generally not allowed in Postfix. It's enforced in maps_find(), instead of in each indiividual dict_xxx.c implementation. Gotcha. I think it would be worth mentioning this in DATABASE_README; I can