On 02/09/2008 08:49 PM, Ruediger Pluem wrote:
On 02/09/2008 08:39 PM, Dirk-Willem van Gulik wrote:
On Sat, 9 Feb 2008, Ruediger Pluem wrote:
+ return apr_table_make(pool, 10);
+ };
+
Why this? Just some type of defensive programming if someone feeds in
a t == NULL?
If yes, I would prefer return NULL instead of creating an empty table.
Garbage in, garbage out :-).
That was my first approach as well. But then I noticed that the users of
this functions virtually always will have to serialize/store the tables;
or otherwise track them. So if we have 3 options -
- if (r->headers_in)
in = ap_cache_cacheable_hdrs_in(
serialize(in)
else
mark a skip or something that you did not
BTW: apr_is_empty_table would be an alternate check that would filter out
both cases: r->headers_in NULL or empty.
Regards
RĂ¼diger