> -----Ursprüngliche Nachricht-----
> Von: Dirk-Willem van Gulik 
> Gesendet: Donnerstag, 17. April 2008 13:05
> An: [email protected]
> Betreff: Centralizing http-proxy knowledge in cache_util.c
> 
> Before I give the other modules a pass over -- does below strawman  
> address everyones
> concerns w.r. to the API changes ?
> 
> To recap:
> 
> -     ap_cache_cacheable_hdrs_out gets depricated. And the repliced
>       code is to be removed from mod_*_cache.
> 
> -     a ap_cache_cacheable_hdrs_in() and ap_cache_cacheable_hdrs_out()
>       are added, which each rely on:
> 
> -     ap_cache_cacheable_headers - which knows the HTTP rules.
> 
> The intention is to make sure that caching modules do no 
> longer have to
> understand the section in RFC 2616 deling with hop-by-hop.
> 
> Right now _out is just a wrapper for ap_cache_cacheable_headers - but
> I expect that we'll have to populate it soon. And to avoid an API  
> version
>   bump I'd thus rather not do it as a #define for now.
> 
> Thanks,
> 
> Dw.
> 

> Index: modules/cache/mod_cache.h
> ===================================================================
> --- modules/cache/mod_cache.h (revision 649044)
> +++ modules/cache/mod_cache.h (working copy)

> @@ -614,3 +623,44 @@
>       }
>       return headers_out;
>   }
> +
> +/* Legacy call - functionally equivalent to 
> ap_cache_cacheable_headers.
> + * @deprecated @see ap_cache_cacheable_headers
> + */
> +CACHE_DECLARE(apr_table_t 
> *)ap_cache_cacheable_hdrs_out(apr_pool_t *p,
> +                                                        
> apr_table_t *t,
> +                                                        
> server_rec *s)
> +{
> +    return ap_cache_cacheable_headers(p,t,s);
> +}
> +
> +/* Create a new table consisting of those elements from an input
> + * headers table that are allowed to be stored in a cache.
> + */
> +CACHE_DECLARE(apr_table_t 
> *)ap_cache_cacheable_headers_in(request_rec  
> * r)
> +{
> +     return ap_cache_cacheable_hdrs(r->pool, r->headers_in, 
> r->server);
> +}
> +
> +/* Create a new table consisting of those elements from an output
> + * headers table that are allowed to be stored in a cache;
> + * ensure there is a content type and capture any errors.
> + */
> +CACHE_DECLARE(apr_table_t  
> *)ap_cache_cacheable_headers_out(request_rec * r)
> +{
> +     apr_table_t *headers_out;
> +
> +     headers_out = ap_cache_cacheable_hdrs(r->pool, r->headers_out,
> +                                                  r->server);

What is this function (ap_cache_cacheable_hdrs)? I am trying to get confused
by all these functions which sound very similar :-).

> +
> +        if (!apr_table_get(headers_out, "Content-Type")
> +            && r->content_type) {
> +            apr_table_setn(headers_out, "Content-Type",
> +                           ap_make_content_type(r, r->content_type));
> +        }
> +
> +        headers_out = apr_table_overlay(r->pool, headers_out,
> +                                        r->err_headers_out);
> +
> +     return headers_out;
> +}

Regards

Rüdiger

Reply via email to