View | Details | Raw Unified | Return to bug 30399
Collapse All | Expand All

(-)httpd-2.0.50/modules/experimental/cache_util.c.orig (-1 / +9 lines)
Lines 21-26 Link Here
21
21
22
/* -------------------------------------------------------------- */
22
/* -------------------------------------------------------------- */
23
23
24
extern module cache_module;
25
24
/* return true if the request is conditional */
26
/* return true if the request is conditional */
25
CACHE_DECLARE(int) ap_cache_request_is_conditional(request_rec *r)
27
CACHE_DECLARE(int) ap_cache_request_is_conditional(request_rec *r)
26
{
28
{
Lines 498-505 Link Here
498
 * headers table that are allowed to be stored in a cache.
500
 * headers table that are allowed to be stored in a cache.
499
 */
501
 */
500
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool,
502
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool,
501
                                                        apr_table_t *t)
503
                                                        apr_table_t *t,
504
                                                        server_rec *s)
502
{
505
{
506
    cache_server_conf *conf;
507
503
    /* Make a copy of the headers, and remove from
508
    /* Make a copy of the headers, and remove from
504
     * the copy any hop-by-hop headers, as defined in Section
509
     * the copy any hop-by-hop headers, as defined in Section
505
     * 13.5.1 of RFC 2616
510
     * 13.5.1 of RFC 2616
Lines 514-518 Link Here
514
    apr_table_unset(headers_out, "Trailers");
519
    apr_table_unset(headers_out, "Trailers");
515
    apr_table_unset(headers_out, "Transfer-Encoding");
520
    apr_table_unset(headers_out, "Transfer-Encoding");
516
    apr_table_unset(headers_out, "Upgrade");
521
    apr_table_unset(headers_out, "Upgrade");
522
    conf = (cache_server_conf *) ap_get_module_config(s->module_config,
523
                                                      &cache_module);
524
    if (!conf->storecookies) apr_table_unset(headers_out, "Set-Cookie");
517
    return headers_out;
525
    return headers_out;
518
}
526
}
(-)httpd-2.0.50/modules/experimental/mod_cache.c.orig (+24 lines)
Lines 799-804 Link Here
799
    ps->no_last_mod_ignore = 0;
799
    ps->no_last_mod_ignore = 0;
800
    ps->ignorecachecontrol = 0;
800
    ps->ignorecachecontrol = 0;
801
    ps->ignorecachecontrol_set = 0 ;
801
    ps->ignorecachecontrol_set = 0 ;
802
    /* store Set-Cookie headers by default to be RFC 2616 compliant */
803
    ps->storecookies = 1;
804
    ps->storecookies_set = 0 ;
802
    return ps;
805
    return ps;
803
}
806
}
804
807
Lines 835-840 Link Here
835
        (overrides->ignorecachecontrol_set == 0)
838
        (overrides->ignorecachecontrol_set == 0)
836
        ? base->ignorecachecontrol
839
        ? base->ignorecachecontrol
837
        : overrides->ignorecachecontrol;
840
        : overrides->ignorecachecontrol;
841
    ps->storecookies  =
842
        (overrides->storecookies_set == 0)
843
        ? base->storecookies
844
        : overrides->storecookies;
838
    return ps;
845
    return ps;
839
}
846
}
840
static const char *set_cache_ignore_no_last_mod(cmd_parms *parms, void *dummy,
847
static const char *set_cache_ignore_no_last_mod(cmd_parms *parms, void *dummy,
Lines 864-869 Link Here
864
    return NULL;
871
    return NULL;
865
}
872
}
866
873
874
static const char *set_cache_store_cookies(cmd_parms *parms,
875
                                           void *dummy, int flag)
876
{
877
    cache_server_conf *conf;
878
879
    conf =
880
        (cache_server_conf *)ap_get_module_config(parms->server->module_config,
881
                                                  &cache_module);
882
    conf->storecookies = flag;
883
    conf->storecookies_set = 1;
884
    return NULL;
885
}
886
867
static const char *add_cache_enable(cmd_parms *parms, void *dummy, 
887
static const char *add_cache_enable(cmd_parms *parms, void *dummy, 
868
                                    const char *type, 
888
                                    const char *type, 
869
                                    const char *url)
889
                                    const char *url)
Lines 994-999 Link Here
994
                  NULL, 
1014
                  NULL, 
995
                  RSRC_CONF, 
1015
                  RSRC_CONF, 
996
                  "Ignore requests from the client for uncached content"),
1016
                  "Ignore requests from the client for uncached content"),
1017
     AP_INIT_FLAG("CacheStoreCookies", set_cache_store_cookies,
1018
                  NULL, 
1019
                  RSRC_CONF, 
1020
                  "Store Set-Cookie headers in cached headers"),
997
    AP_INIT_TAKE1("CacheLastModifiedFactor", set_cache_factor, NULL, RSRC_CONF,
1021
    AP_INIT_TAKE1("CacheLastModifiedFactor", set_cache_factor, NULL, RSRC_CONF,
998
                  "The factor used to estimate Expires date from "
1022
                  "The factor used to estimate Expires date from "
999
                  "LastModified date"),
1023
                  "LastModified date"),
(-)httpd-2.0.50/modules/experimental/mod_cache.h.orig (-1 / +4 lines)
Lines 136-141 Link Here
136
    /** ignore client's requests for uncached responses */
136
    /** ignore client's requests for uncached responses */
137
    int ignorecachecontrol;
137
    int ignorecachecontrol;
138
    int ignorecachecontrol_set;
138
    int ignorecachecontrol_set;
139
    /** store Set-Cookie headers */
140
    int storecookies;
141
    int storecookies_set;
139
} cache_server_conf;
142
} cache_server_conf;
140
143
141
/* cache info information */
144
/* cache info information */
Lines 236-242 Link Here
236
/* Create a new table consisting of those elements from a request_rec's
239
/* Create a new table consisting of those elements from a request_rec's
237
 * headers_out that are allowed to be stored in a cache
240
 * headers_out that are allowed to be stored in a cache
238
 */
241
 */
239
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool, apr_table_t *t);
242
CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool, apr_table_t *t, server_rec *s);
240
243
241
/**
244
/**
242
 * cache_storage.c
245
 * cache_storage.c
(-)httpd-2.0.50/modules/experimental/mod_disk_cache.c.orig (-1 / +1 lines)
Lines 560-566 Link Here
560
560
561
        if (r->headers_out) {
561
        if (r->headers_out) {
562
            int i;
562
            int i;
563
            apr_table_t* headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out);
563
            apr_table_t* headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out, r->server);
564
            apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(headers_out)->elts;
564
            apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(headers_out)->elts;
565
            for (i = 0; i < apr_table_elts(headers_out)->nelts; ++i) {
565
            for (i = 0; i < apr_table_elts(headers_out)->nelts; ++i) {
566
                if (elts[i].key != NULL) {
566
                if (elts[i].key != NULL) {
(-)httpd-2.0.50/modules/experimental/mod_mem_cache.c.orig (-2 / +4 lines)
Lines 822-834 Link Here
822
    /* Precompute how much storage we need to hold the headers */
822
    /* Precompute how much storage we need to hold the headers */
823
    rc = serialize_table(&mobj->header_out, 
823
    rc = serialize_table(&mobj->header_out, 
824
                         &mobj->num_header_out, 
824
                         &mobj->num_header_out, 
825
                         ap_cache_cacheable_hdrs_out(r->pool, r->headers_out));   
825
                         ap_cache_cacheable_hdrs_out(r->pool, r->headers_out, 
826
                         r->server));   
826
    if (rc != APR_SUCCESS) {
827
    if (rc != APR_SUCCESS) {
827
        return rc;
828
        return rc;
828
    }
829
    }
829
    rc = serialize_table(&mobj->err_header_out, 
830
    rc = serialize_table(&mobj->err_header_out, 
830
                         &mobj->num_err_header_out, 
831
                         &mobj->num_err_header_out, 
831
                         ap_cache_cacheable_hdrs_out(r->pool, r->err_headers_out));   
832
                         ap_cache_cacheable_hdrs_out(r->pool, r->err_headers_out,
833
                         r->server));   
832
    if (rc != APR_SUCCESS) {
834
    if (rc != APR_SUCCESS) {
833
        return rc;
835
        return rc;
834
    }
836
    }

Return to bug 30399