Changes with Apache 2.0.40
+ *) Fix segfault in mod_mem_cache most frequently observed when
+ serving the same file to multiple clients on an MP machine.
+ [Bill Stoddard]
*) mod_rewrite can now set cookies (RewriteRule (.*) - [CO=name:$1:.domain])
[Brian Degenhardt <bmd@mp3.com>, Ian Holsman]
const char *next = types;
const char *type;
apr_status_t rv;
- cache_info *info;
+ cache_handle_t *h;
+ // cache_info *info;
char *key;
cache_request_rec *cache = (cache_request_rec *)
ap_get_module_config(r->request_config, &cache_module);
return rv;
}
/* go through the cache types till we get a match */
- cache->handle = apr_palloc(r->pool, sizeof(cache_handle_t));
+ h = cache->handle = apr_palloc(r->pool, sizeof(cache_handle_t));
while (next) {
type = ap_cache_tokstr(r->pool, next, &next);
- switch ((rv = cache_run_open_entity(cache->handle, r, type, key))) {
+ switch ((rv = cache_run_open_entity(h, r, type, key))) {
case OK: {
char *vary = NULL;
- info = &(cache->handle->cache_obj->info);
- if (cache_read_entity_headers(cache->handle, r) != APR_SUCCESS) {
+ if (cache_read_entity_headers(h, r) != APR_SUCCESS) {
/* TODO: Handle this error */
return DECLINED;
}
* language negotiated document in a different language by mistake.
*
* This code makes the assumption that the storage manager will
- * cache the info->req_hdrs if the response contains a Vary
+ * cache the req_hdrs if the response contains a Vary
* header.
*
* RFC2616 13.6 and 14.44 describe the Vary mechanism.
* request identical? If not, we give up and do a straight get
*/
h1 = ap_table_get(r->headers_in, name);
- h2 = ap_table_get(info->req_hdrs, name);
+ h2 = ap_table_get(h->req_hdrs, name);
if (h1 == h2) {
/* both headers NULL, so a match - do nothing */
}
apr_time_t ius; /* If-UnModified_Since header value */
const char *im; /* If-Match header value */
const char *inm; /* If-None-Match header value */
- apr_table_t *req_hdrs; /* These are the original request headers */
+
};
/* cache handle information */
apr_status_t (*write_body)(cache_handle_t *h, request_rec *r, apr_bucket_brigade *b);
apr_status_t (*read_headers) (cache_handle_t *h, request_rec *r);
apr_status_t (*read_body) (cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade *bb);
+ apr_table_t *req_hdrs; /* These are the original request headers */
};
/* per request cache information */
h->write_headers = &write_headers;
h->remove_entity = &remove_entity;
h->cache_obj = obj;
-
+ h->req_hdrs = NULL; /* Pick these up in read_headers() */
return OK;
}
{
int rc;
mem_cache_object_t *mobj = (mem_cache_object_t*) h->cache_obj->vobj;
- cache_info *info = &(h->cache_obj->info);
- info->req_hdrs = apr_table_make(r->pool, mobj->num_req_hdrs);
-
+ h->req_hdrs = apr_table_make(r->pool, mobj->num_req_hdrs);
r->headers_out = apr_table_make(r->pool, mobj->num_header_out);
r->subprocess_env = apr_table_make(r->pool, mobj->num_subprocess_env);
r->notes = apr_table_make(r->pool, mobj->num_notes);
rc = unserialize_table(mobj->req_hdrs,
mobj->num_req_hdrs,
- info->req_hdrs);
+ h->req_hdrs);
rc = unserialize_table( mobj->header_out,
mobj->num_header_out,
r->headers_out);