On 01/02/2009 09:09 PM, [email protected] wrote: > Author: wrowe > Date: Fri Jan 2 12:08:59 2009 > New Revision: 730835 > > URL: http://svn.apache.org/viewvc?rev=730835&view=rev > Log: > Clean up fugly initialization of AcceptFilter mappings > > Modified: > httpd/httpd/trunk/server/core.c > > Modified: httpd/httpd/trunk/server/core.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=730835&r1=730834&r2=730835&view=diff > ============================================================================== > --- httpd/httpd/trunk/server/core.c (original) > +++ httpd/httpd/trunk/server/core.c Fri Jan 2 12:08:59 2009 > @@ -441,13 +441,10 @@ > conf->subreq_limit = 0; > > conf->protocol = NULL; > - conf->accf_map = apr_table_make(a, 5); > - > -#ifdef APR_TCP_DEFER_ACCEPT > - apr_table_set(conf->accf_map, "http", "data"); > - apr_table_set(conf->accf_map, "https", "data"); > -#endif > + conf->accf_map = is_virtual ? NULL : apr_table_make(a, 5); > > + /* A mapping only makes sense in the global context */ > + if (conf->accf_map) { > #if APR_HAS_SO_ACCEPTFILTER > #ifndef ACCEPT_FILTER_NAME > #define ACCEPT_FILTER_NAME "httpready" > @@ -458,9 +455,13 @@ > #endif > #endif > #endif > - apr_table_set(conf->accf_map, "http", ACCEPT_FILTER_NAME); > - apr_table_set(conf->accf_map, "https", "dataready"); > + apr_table_setn(conf->accf_map, "http", ACCEPT_FILTER_NAME); > + apr_table_setn(conf->accf_map, "https", "dataready"); > +#else > + apr_table_setn(conf->accf_map, "http", "data"); > + apr_table_setn(conf->accf_map, "https", "data");
Don't we need to put the two lines above into #ifdef APR_TCP_DEFER_ACCEPT #endif ? Otherwise the table will not be empty anymore in the case that neither APR_HAS_SO_ACCEPTFILTER nor APR_TCP_DEFER_ACCEPT is set. Regards RĂ¼diger
