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 
> stages).
> 
> My question: Why copy the string?  Why not simply pass the previous 
> stage's result pointer as the query for the next stage (or return it to 

The lookup result is volatile. If you make another dict call then the
result may be clobbered.

        Wietse

> the caller)?  See the attached patch for what I mean.  Is it because a 
> table implementation is allowed to invalidate the result memory from a 
> previous lookup before it reads the current query?
> 
> Thanks,
> Richard
> 
> [1] 
> https://github.com/vdukhovni/postfix/blob/32475272ffd1d92ecb03f60bf445ef17669205b7/postfix/src/util/dict_pipe.c#L69-L87
[ Attachment, skipping... ]

> _______________________________________________
> Postfix-devel mailing list -- postfix-devel@postfix.org
> To unsubscribe send an email to postfix-devel-le...@postfix.org
_______________________________________________
Postfix-devel mailing list -- postfix-devel@postfix.org
To unsubscribe send an email to postfix-devel-le...@postfix.org

Reply via email to