ASF Bugzilla – Attachment 19948 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]
don't use apr_table_copy to store/recall headers
trunk-memcache_deep_copy.diff (text/plain), 1.87 KB, created by
Eric Covener
on 2007-04-13 05:22:46 UTC
(
hide
)
Description:
don't use apr_table_copy to store/recall headers
Filename:
MIME Type:
Creator:
Eric Covener
Created:
2007-04-13 05:22:46 UTC
Size:
1.87 KB
patch
obsolete
>Index: mod_mem_cache.c >=================================================================== >--- mod_mem_cache.c (revision 528321) >+++ mod_mem_cache.c (working copy) >@@ -52,6 +52,7 @@ > > module AP_MODULE_DECLARE_DATA mem_cache_module; > >+static int deep_copy(void *v, const char *key, const char *val); > typedef enum { > CACHE_TYPE_FILE = 1, > CACHE_TYPE_HEAP, >@@ -543,8 +544,10 @@ > { > 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 = apr_table_make(r->pool, 20); >+ apr_table_do(deep_copy, h->req_hdrs, mobj->req_hdrs, NULL); >+ h->resp_hdrs = apr_table_make(r->pool, 20); >+ apr_table_do(deep_copy, h->resp_hdrs, mobj->header_out, NULL); > > return OK; > } >@@ -586,7 +589,8 @@ > * - 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 = apr_table_make(mobj->pool, 20); >+ apr_table_do(deep_copy, mobj->req_hdrs, r->headers_in, NULL); > > /* Precompute how much storage we need to hold the headers */ > headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out, >@@ -600,7 +604,8 @@ > } > > 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 = apr_table_make(mobj->pool, 20); >+ apr_table_do(deep_copy, mobj->header_out, headers_out, NULL); > > /* Init the info struct */ > obj->info.status = info->status; >@@ -940,6 +945,13 @@ > {NULL} > }; > >+static int deep_copy(void *v, const char *key, const char *val) >+{ >+ apr_table_add(v, key, val); >+ return 1; >+} >+ >+ > static const cache_provider cache_mem_provider = > { > &remove_entity,
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