Lines 427-433
int cache_select(cache_request_rec *cache, request
Link Here
|
427 |
} |
427 |
} |
428 |
|
428 |
|
429 |
static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p, |
429 |
static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p, |
430 |
const char *uri, apr_uri_t *parsed_uri, const char **key) |
430 |
const char *uri, const char *query, |
|
|
431 |
apr_uri_t *parsed_uri, |
432 |
const char **key) |
431 |
{ |
433 |
{ |
432 |
cache_server_conf *conf; |
434 |
cache_server_conf *conf; |
433 |
char *port_str, *hn, *lcs; |
435 |
char *port_str, *hn, *lcs; |
Lines 563-569
static apr_status_t cache_canonicalise_key(request
Link Here
|
563 |
* if needed. |
565 |
* if needed. |
564 |
*/ |
566 |
*/ |
565 |
path = uri; |
567 |
path = uri; |
566 |
querystring = parsed_uri->query; |
568 |
querystring = apr_pstrdup(p, query ? query : parsed_uri->query); |
567 |
if (conf->ignore_session_id->nelts) { |
569 |
if (conf->ignore_session_id->nelts) { |
568 |
int i; |
570 |
int i; |
569 |
char **identifier; |
571 |
char **identifier; |
Lines 588-594
static apr_status_t cache_canonicalise_key(request
Link Here
|
588 |
/* |
590 |
/* |
589 |
* Check if the identifier is in the querystring and cut it out. |
591 |
* Check if the identifier is in the querystring and cut it out. |
590 |
*/ |
592 |
*/ |
591 |
if (querystring) { |
593 |
if (querystring && *querystring) { |
592 |
/* |
594 |
/* |
593 |
* First check if the identifier is at the beginning of the |
595 |
* First check if the identifier is at the beginning of the |
594 |
* querystring and followed by a '=' |
596 |
* querystring and followed by a '=' |
Lines 605-611
static apr_status_t cache_canonicalise_key(request
Link Here
|
605 |
* identifier with a '&' and append a '=' |
607 |
* identifier with a '&' and append a '=' |
606 |
*/ |
608 |
*/ |
607 |
complete = apr_pstrcat(p, "&", *identifier, "=", NULL); |
609 |
complete = apr_pstrcat(p, "&", *identifier, "=", NULL); |
608 |
param = strstr(querystring, complete); |
610 |
param = ap_strstr_c(querystring, complete); |
609 |
/* If we found something we are sitting on the '&' */ |
611 |
/* If we found something we are sitting on the '&' */ |
610 |
if (param) { |
612 |
if (param) { |
611 |
param++; |
613 |
param++; |
Lines 669-675
static apr_status_t cache_canonicalise_key(request
Link Here
|
669 |
apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, |
671 |
apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, |
670 |
const char **key) |
672 |
const char **key) |
671 |
{ |
673 |
{ |
672 |
return cache_canonicalise_key(r, p, r->uri, &r->parsed_uri, key); |
674 |
const char *args = r->args ? r->args : ""; |
|
|
675 |
return cache_canonicalise_key(r, p, r->uri, args, &r->parsed_uri, key); |
673 |
} |
676 |
} |
674 |
|
677 |
|
675 |
/* |
678 |
/* |
Lines 709-720
int cache_invalidate(cache_request_rec *cache, req
Link Here
|
709 |
|
712 |
|
710 |
location = apr_table_get(r->headers_out, "Location"); |
713 |
location = apr_table_get(r->headers_out, "Location"); |
711 |
if (location) { |
714 |
if (location) { |
712 |
if (APR_SUCCESS != apr_uri_parse(r->pool, location, &location_uri) |
715 |
if (apr_uri_parse(r->pool, location, &location_uri) |
713 |
|| APR_SUCCESS |
716 |
|| cache_canonicalise_key(r, r->pool, |
714 |
!= cache_canonicalise_key(r, r->pool, location, |
717 |
location, NULL, |
715 |
&location_uri, &location_key) |
718 |
&location_uri, &location_key) |
716 |
|| !(r->parsed_uri.hostname && location_uri.hostname |
719 |
|| !(r->parsed_uri.hostname |
717 |
&& !strcmp(r->parsed_uri.hostname, |
720 |
&& location_uri.hostname |
|
|
721 |
&& !strcmp(r->parsed_uri.hostname, |
718 |
location_uri.hostname))) { |
722 |
location_uri.hostname))) { |
719 |
location_key = NULL; |
723 |
location_key = NULL; |
720 |
} |
724 |
} |
Lines 722-735
int cache_invalidate(cache_request_rec *cache, req
Link Here
|
722 |
|
726 |
|
723 |
content_location = apr_table_get(r->headers_out, "Content-Location"); |
727 |
content_location = apr_table_get(r->headers_out, "Content-Location"); |
724 |
if (content_location) { |
728 |
if (content_location) { |
725 |
if (APR_SUCCESS |
729 |
if (apr_uri_parse(r->pool, content_location, |
726 |
!= apr_uri_parse(r->pool, content_location, |
730 |
&content_location_uri) |
727 |
&content_location_uri) |
731 |
|| cache_canonicalise_key(r, r->pool, |
728 |
|| APR_SUCCESS |
732 |
content_location, NULL, |
729 |
!= cache_canonicalise_key(r, r->pool, content_location, |
733 |
&content_location_uri, |
730 |
&content_location_uri, &content_location_key) |
734 |
&content_location_key) |
731 |
|| !(r->parsed_uri.hostname && content_location_uri.hostname |
735 |
|| !(r->parsed_uri.hostname |
732 |
&& !strcmp(r->parsed_uri.hostname, |
736 |
&& content_location_uri.hostname |
|
|
737 |
&& !strcmp(r->parsed_uri.hostname, |
733 |
content_location_uri.hostname))) { |
738 |
content_location_uri.hostname))) { |
734 |
content_location_key = NULL; |
739 |
content_location_key = NULL; |
735 |
} |
740 |
} |