[pfx-dev] Re: dict_cdb: implement sequence operation

2025-01-09 Thread Michael Tokarev via Postfix-devel
09.01.2025 23:44, Wietse Venema via Postfix-devel wrote: dict_cdb.c: In function 'dict_cdbq_sequence': dict_cdb.c:202:20: error: 'DICT_CDBQ' has no member named 'seq_cpos'; did you mean 'seq_cptr'? 202 | dict_cdbq->seq_cpos = 0; |^~~~ |

[pfx-dev] Re: dict_cdb: implement sequence operation

2025-01-09 Thread Wietse Venema via Postfix-devel
dict_cdb.c: In function 'dict_cdbq_sequence': dict_cdb.c:202:20: error: 'DICT_CDBQ' has no member named 'seq_cpos'; did you mean 'seq_cptr'? 202 | dict_cdbq->seq_cpos = 0; |^~~~ |seq_cptr Assuming that seq_cptr was intended, I adde

[pfx-dev] Re: dict_cdb: implement sequence operation

2025-01-09 Thread Wietse Venema via Postfix-devel
Michael Tokarev via Postfix-devel: > Move common code to get a piece of data from cdb into > its own function. > > Signed-off-by: Michael Tokarev > --- > On top of the previous patch. I'll draft some text for CDB_README.html. Wietse ___ Postfi

[pfx-dev] Re: cdb dict: using static buffer

2025-01-09 Thread Wietse Venema via Postfix-devel
Michael Tokarev via Postfix-devel: > Hi! > > I noticed that dict_cdb uses static buffer to read the value, > while all other maps use per-instance val_buf vstring or similar, > and even the fold_buf is per-instance. I wonder if something like > the below is actually necessary. It does make sense

[pfx-dev] dict_cdb: implement sequence operation

2025-01-09 Thread Michael Tokarev via Postfix-devel
Move common code to get a piece of data from cdb into its own function. Signed-off-by: Michael Tokarev --- On top of the previous patch. src/util/dict_cdb.c | 89 + 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/src/util/dict_cdb.c b/

[pfx-dev] dict_cdb: eliminate static buffer for the lookup result

2025-01-09 Thread Michael Tokarev via Postfix-devel
use per-instance val_buf vstring buffer instead of single static buf for all cdb instances, which might be unsafe if more than one result is being in use at the same time. Signed-off-by: Michael Tokarev --- previous patch has been garbled by cut-n-paste. Also move val_buf init a bit earlier. sr

[pfx-dev] cdb dict: using static buffer

2025-01-09 Thread Michael Tokarev via Postfix-devel
Hi! I noticed that dict_cdb uses static buffer to read the value, while all other maps use per-instance val_buf vstring or similar, and even the fold_buf is per-instance. I wonder if something like the below is actually necessary. diff --git a/src/util/dict_cdb.c b/src/util/dict_cdb.c index a91