ASF Bugzilla – Attachment 20065 Details for
Bug 41551
mod_mem_cache cache incorrect header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
deep table copy
mem-cache-deep-table-copy.patch (text/plain), 1.76 KB, created by
Davi Arnaut
on 2007-04-27 20:14:24 UTC
(
hide
)
Description:
deep table copy
Filename:
MIME Type:
Creator:
Davi Arnaut
Created:
2007-04-27 20:14:24 UTC
Size:
1.76 KB
patch
obsolete
>Index: modules/cache/mod_mem_cache.c >=================================================================== >--- modules/cache/mod_mem_cache.c (revision 532492) >+++ modules/cache/mod_mem_cache.c (working copy) >@@ -539,12 +539,26 @@ > return OK; > } > >+static apr_table_t *deep_table_copy(apr_pool_t *p, const apr_table_t *table) >+{ >+ const apr_array_header_t *array = apr_table_elts(table); >+ apr_table_entry_t *elts = (apr_table_entry_t *) array->elts; >+ apr_table_t *copy = apr_table_make(p, array->nelts); >+ int i; >+ >+ for (i = 0; i < array->nelts; i++) { >+ apr_table_add(copy, elts[i].key, elts[i].val); >+ } >+ >+ return copy; >+} >+ > static apr_status_t recall_headers(cache_handle_t *h, request_rec *r) > { > mem_cache_object_t *mobj = (mem_cache_object_t*) h->cache_obj->vobj; > >- h->req_hdrs = apr_table_copy(r->pool, mobj->req_hdrs); >- h->resp_hdrs = apr_table_copy(r->pool, mobj->header_out); >+ h->req_hdrs = deep_table_copy(r->pool, mobj->req_hdrs); >+ h->resp_hdrs = deep_table_copy(r->pool, mobj->header_out); > > return OK; > } >@@ -585,7 +599,7 @@ > * - The original response headers (for returning with a cached response) > * - The body of the message > */ >- mobj->req_hdrs = apr_table_copy(mobj->pool, r->headers_in); >+ mobj->req_hdrs = deep_table_copy(mobj->pool, r->headers_in); > > /* Precompute how much storage we need to hold the headers */ > headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out, >@@ -599,7 +613,7 @@ > } > > headers_out = apr_table_overlay(r->pool, headers_out, r->err_headers_out); >- mobj->header_out = apr_table_copy(mobj->pool, headers_out); >+ mobj->header_out = deep_table_copy(mobj->pool, headers_out); > > /* Init the info struct */ > obj->info.status = info->status;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41551
:
19948
|
20064
| 20065 |
20150