perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/src/modules/perl modperl_config.c
Date Tue, 20 Nov 2001 03:57:11 GMT
Doug MacEachern wrote:

> On Tue, 20 Nov 2001, Stas Bekman wrote:
>  
> 
>>exactly for the same reason that addn() should be used. 
>>apr_table_overlay  uses setn() which will loose all pairs with the same 
>>key but the last one added.
>>
>>apr_table_overlay:
>>  *  for (i = 0; i < barr->nelts; ++i) {
>>  *      if (flags & APR_OVERLAP_TABLES_MERGE) {
>>  *          apr_table_mergen(a, belt[i].key, belt[i].val);
>>  *      }
>>  *      else {
>>  *          apr_table_setn(a, belt[i].key, belt[i].val);
>>             ^^^^^^^^^^^^^^^
>>  *      }
>>  *  }
>>
> 
> that is not apr_table_overlay(), that is apr_table_overlap().
> and the current version of overlap uses addn().
> 
> i think we should be using apr_table_overlay() just as 1.x does, no?

oops, still waking up. The reason not to use apr_table_overlay() is:


/**
  * Merge two tables into one new table
  * @param p The pool to use for the new table
  * @param overlay The first table to put in the new table
  * @param base The table to add at the end of the new table
  * @return A new table containing all of the data from the two passed in
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  */
APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p,
                                              const apr_table_t *overlay,
                                              const apr_table_t *base);


which as we have discussed is not what we want, since we don't want all 
the data from the two. The overlay structure should override the base 
structure if the same key exists in both. I guess I should put a better 
comment in place.


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message