httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: obsolete functions?
Date Sun, 06 Feb 2005 17:03:20 GMT
Max Kellermann <max@duempel.org> writes:

> I noticed the following functions, but couldn't explain their use in
> libapreq2:
>
>  apreq_quote
>  apreq_quote_once
>  apreq_memmem
>
> apreq_quote is used by apreq_join with APREQ_JOIN_QUOTE, but I do not
> see yet how this option helps apreq2. apreq_memmem is not used at all.

The quote functions are there mainly to give users a way to create
rfc-compliant cookie values and attributes.  For portability reasons
we can't enforce proper quoting in apreq_cookie_bake(2).  The best
we can do is provide functions that do "the right thing", and let 
our users take advantage of them when it makes sense for them to do 
it.

apreq_memmem is a relic from libapreq1;  I don't mind removing
it because apreq_index does basically the same job.

> Why are both apreq_encode and apreq_escape exported? apreq_encode is
> potentially unsafe - you need a 3*length+1 buffer in the worst case;
> this is not explicitly documented. We should only export the safe
> equivalent function apreq_escape.

I disagree; we should just document the 3*length+1 figure for 
apreq_encode.  It's useful to have an encoding function that
isn't tied to a pool allocator. For example, the perl glue 
uses apreq_encode to write the result directly to a perl SV.
Replacing that with apreq_escape would just be a waste of 
resources.

-- 
Joe Schaefer


Mime
View raw message