1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

56 Commits

Author SHA1 Message Date
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Graham Leggett
43fc2d47c7 mod_cache: When a request other than GET or HEAD arrives, we must
invalidate existing cache entities as per RFC2616 13.10. PR 15868.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070179 13f79535-47bb-0310-9956-ffa450edef68
2011-02-13 02:03:29 +00:00
Graham Leggett
f5d5cd33c5 Use ap_log_rerror() instead of ap_log_error() across mod_cache and
mod_disk_cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023462 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 11:34:03 +00:00
Graham Leggett
c7194e2e36 Don't attempt to kill a stale entry that cannot be revalidated so early
in the process, as this will happen later anyway as necessary. We may want
to serve the stale entry should the backend not be available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023398 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 01:24:24 +00:00
Graham Leggett
3b619648dc Don't attempt to remove the existing conditional headers until we have
committed to adding our own.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023396 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:50:28 +00:00
Graham Leggett
7ce9abf618 Support Cache-Control: only-if-cached, as per RFC2616 14.9.4.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023394 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:20:41 +00:00
Graham Leggett
fc7955190f Fix the error cases in the cache_select() loop. On error we must loop around
to the next provider, not return DECLINED too early, except for the
revalidate case, where returning DECLINED is correct behaviour.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023392 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:01:45 +00:00
Graham Leggett
44584f6a5a Fix the return values in the cache_select() function, we don't return APR
error codes in this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023390 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:42:25 +00:00
Graham Leggett
796d4cd074 Begin the process of optimising the parsing of Cache-Control headers. Parse
the incoming Cache-Control and Pragma headers once, instead of on each test.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023360 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 19:30:08 +00:00
Graham Leggett
38d82baaae mod_cache: Don't regenerate the cache key if we have already generated it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004373 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 19:27:22 +00:00
Graham Leggett
d29eacb478 mod_cache: Allow control over the base URL of reverse proxied requests
using the CacheKeyBaseURL directive, so that the cache key can be
calculated from the endpoint URL instead of the server URL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003963 13f79535-47bb-0310-9956-ffa450edef68
2010-10-03 13:23:39 +00:00
Graham Leggett
46a24e84f8 Remove a relic from the original error code, and fix segfaults in the
process.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000395 13f79535-47bb-0310-9956-ffa450edef68
2010-09-23 10:17:07 +00:00
Graham Leggett
fe32c3562b Make cache_provider_list and cache_request_rec private by moving them
out of mod_cache.h.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000247 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 21:35:38 +00:00
Graham Leggett
5c7154ed33 Make cache_server_conf, cache_enable and cache_disable private. Remove
public prefixes from ap_cache_accept_headers, ap_cache_try_lock and
ap_cache_get_providers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000211 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:44:50 +00:00
Graham Leggett
8a91dc4dbe Make ap_cache_accept_headers, ap_cache_accept_headers, ap_cache_try_lock and
ap_cache_check_freshness private.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000187 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:28:11 +00:00
Graham Leggett
502a305b1d Remove the MOD_CACHE_REQUEST_REC hack, and pass the cache_request_rec
structure through mod_cache's function parameters in the usual way.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000152 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:35:26 +00:00
Graham Leggett
c8de96f357 Move private cache_* declarations out of the public mod_cache.h file.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999681 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 22:55:22 +00:00
Graham Leggett
d8fc5d96a8 mod_cache: Give the cache provider the opportunity to choose to cache
or not cache based on the buckets present in the brigade, such as the
presence of a FILE bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999630 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 20:43:44 +00:00
Graham Leggett
c3084aa4de mod_cache: Check the request to determine whether we are allowed
to return cached content at all, and respect a "Cache-Control:
no-cache" header from a client. Previously, "no-cache" would
behave like "max-age=0".


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992625 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 15:20:30 +00:00
Graham Leggett
8991d4795f mod_cache: Use a proper filter context to hold filter data instead
of misusing the per-request configuration. Fixes a segfault on trunk
when the normal handler is used.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992614 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 14:42:30 +00:00
Paul Querna
ad53d4dcbd CVE-2010-1452: Fix handling of missing path segments in the parsed URI structure.
If a specially crafted request was sent, it is possible to crash mod_dav, 
mod_cache or mod_session, as they accessed a field that is set to NULL
by the URI parser, assuming that it always put in a valid string.

PR: 49246
Submitted by: Mark Drayton
Patch by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966348 13f79535-47bb-0310-9956-ffa450edef68
2010-07-21 18:25:01 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Stefan Fritsch
2173f71a93 Allow several of the configured session identifiers to be found and removed in
a single request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@897705 13f79535-47bb-0310-9956-ffa450edef68
2010-01-10 21:07:26 +00:00
Ruediger Pluem
8a66869e0c * Do an exact match of the keys defined by CacheIgnoreURLSessionIdentifiers
against the querystring instead of a partial match.

PR: 48401
Submitted by: Dodou Wang <wangdong.08 gmail.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@892289 13f79535-47bb-0310-9956-ffa450edef68
2009-12-18 16:03:13 +00:00
Graham Leggett
2c379cc6fb mod_cache: Introduce the thundering herd lock, a mechanism to keep
the flood of requests at bay that strike a backend webserver as
a cached entity goes stale.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808212 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 22:46:35 +00:00
Ruediger Pluem
023b0a4f61 * Correctly detect if CacheIgnoreURLSessionIdentifiers is set.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@778439 13f79535-47bb-0310-9956-ffa450edef68
2009-05-25 15:24:47 +00:00
Ruediger Pluem
d2700640cd * Add CacheIgnoreURLSessionIdentifiers directive to ignore
defined session identifiers encoded in the URL when caching.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@777042 13f79535-47bb-0310-9956-ffa450edef68
2009-05-21 10:42:54 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Ruediger Pluem
1fb72c6dd2 * Do not do Range requests if we use our own conditionals for validating
a cache entity: If we get 304 the Range does not matter and otherwise the
  entity changed and we want to have the complete entity.

PR: 44579


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636653 13f79535-47bb-0310-9956-ffa450edef68
2008-03-13 07:28:40 +00:00
Ruediger Pluem
477744b538 * Save the key we generate during our first run of cache_generate_key_default
on each request in the request_config. During consecutive runs of
  cache_generate_key_default during processing the request we restore it
  from there as we might not be able to generate the same key again as
  the ingredients used to compose the key might have changed and we constantly
  must use a key that could be generated during the quick handler phase.

PR: 41475


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@506621 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 20:29:04 +00:00
Ruediger Pluem
8a7fb4574c * Add CacheIgnoreQueryString directive to cache requests with a query string
even if no expiration time is specified. Futhermore the query string will not
  be used for key generation such that requests to the same URI path, but with
  different query strings are mapped to the same cache entity. Turning this
  setting to ON violates RFC 2616/13.9 and thus it is turned off by default.

PR: 41484
Submitted by: Fredrik Widlund <fredrik.widlund qbrick.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@504183 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 15:55:50 +00:00
Ruediger Pluem
7410019c69 * Remove expired content from cache that cannot be revalidated.
PR: 30370


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481886 13f79535-47bb-0310-9956-ffa450edef68
2006-12-03 20:51:13 +00:00
Ruediger Pluem
e6a844c031 * Use the query string stored in r->parsed_uri.query instead of r->args
as r->args could have been changed (e.g. via mod_rewrite) after the quick
  handler hook. This causes resources to be stored under a key, where they
  cannot be fetched again in the quick handler.

PR: 40805


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@476625 13f79535-47bb-0310-9956-ffa450edef68
2006-11-18 22:17:33 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Ruediger Pluem
6b175e597f * Keep the Content-Type for successfully revalidated
cached objects, by unsetting possible Content-Type headers in
  r->headers_out and r->err_headers_out as they may be different to what
  we have received from the cache.
  Actually they are not needed as r->content_type set by
  ap_set_content_type a few lines above will be used in the store_headers
  functions of the storage providers as a fallback and the HTTP_HEADER filter
  does overwrite the Content-Type header with r->content_type anyway.

PR: 39647


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@410370 13f79535-47bb-0310-9956-ffa450edef68
2006-05-30 20:48:09 +00:00
Ruediger Pluem
db02633be5 * Cleanup the code by replacing some inline code to lower-case a string with
ap_str_tolower.

Proposed by: Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@408729 13f79535-47bb-0310-9956-ffa450edef68
2006-05-22 19:05:09 +00:00
Ruediger Pluem
6ce4498198 * Fix const compiler warning introduced by r407357.
Noticed by: Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@408154 13f79535-47bb-0310-9956-ffa450edef68
2006-05-21 10:29:09 +00:00
Ruediger Pluem
a3d86dbf15 * Handle the cases "no proxy request" and "reverse proxy request" in the same
manner, when setting scheme and port_str. This is needed because if a cached
  entry is looked up by mod_cache's quick handler r->proxyreq
  is still unset in the reverse proxy case as it only gets set in the
  translate name hook (either by ProxyPass or mod_rewrite) which is run
  after the quick handler hook. This is different to the forward proxy
  case where it gets set before the quick handler is run (in the
  post_read_request hook).
  If a cache entry is created by the CACHE_SAVE filter we always have
  r->proxyreq set correctly.
  Also set scheme to ap_http_scheme(r) instead of "http" to handle SSL
  correctly.

PR: 39593


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@407357 13f79535-47bb-0310-9956-ffa450edef68
2006-05-17 19:16:43 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Ruediger Pluem
bb2af228cd * Fix PR38017 by handling the selection of the hostname in the same way for
non proxied and reverse proxied requests.

  We need to handle both cases in the same manner as for the reverse proxy
  case we have the following situation:

  If a cached entry is looked up by mod_cache's quick handler r->proxyreq
  is still unset in the reverse proxy case as it only gets set in the
  translate name hook (either by ProxyPass or mod_rewrite) which is run
  after the quick handler hook. This is different to the forward proxy
  case where it gets set before the quick handler is run (in the
  post_read_request hook).
  If a cache entry is created by the CACHE_SAVE filter we always have
  r->proxyreq set correctly.
  So we must ensure that in the reverse proxy case we use the same code
  path and using the canonical name seems to be the right thing to do
  in the reverse proxy case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@367798 13f79535-47bb-0310-9956-ffa450edef68
2006-01-10 21:34:11 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Colm MacCarthaigh
6eeba097be Fixes and cleanups for mod_cache;
* Add r->uri to the debug messages in the quick handler; makes debugging
      easier.
    
    * Always reset headers_in for lookup's, some modules make subrequests
      and then rewrite the url. Having a conditional request at this point
      is not what they expect (nor reasonable for them to handle). 

    * Don't store a per-request config on lookups; for the same reason.

    * Return DECLINED when in lookup mode and ap_meets_conditions() indicated
      we have the content but don't know if it's fresh or not. We have no idea
      whether the backend will have a 404, a 304 or any other kind of a 
      response - so we have to assume we cannot handle the request.

    * remove the unused "url" argument from the cache_create_entity() function

    * Whitespace/comment fixups in mod_cache.h



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291588 13f79535-47bb-0310-9956-ffa450edef68
2005-09-26 09:21:45 +00:00
Colm MacCarthaigh
c6700d7708 remove some unused variables and re-name cache_select_url() to simply
cache_select()



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239420 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 15:25:08 +00:00
Colm MacCarthaigh
2e702882bd Improve the cache hit/miss ratio by canonicalising the url key. hostname's
are matched case-insensitively, port-based vhosts are catered for and the
scheme included for future multi-scheme caching compatibility.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239407 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 13:50:47 +00:00
Justin Erenkrantz
03a775765f Move the debuging log message about the removal of a url from
cache_remove_url_filter to cache_remove_url.

Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232335 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 16:57:13 +00:00
Joe Orton
5d7d8f280f * modules/cache/cache_storage.c (cache_remove_url): Remove unused
variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232272 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 11:32:55 +00:00
Justin Erenkrantz
d757d824b8 mod_cache: Implement remove URL via a filter.
Remove entities from the cache when re-validation receives a 404 or other
content-no-longer-present error.

Suggested by: Paul Querna, Justin Erenkrantz
Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231487 13f79535-47bb-0310-9956-ffa450edef68
2005-08-11 17:35:48 +00:00
Sander Striker
97851ed800 Another mod_cache fixlet.
* modules/cache/mod_cache.c

  (cache_url_handler): Add more debug output.  Restore original request
   headers when CACHE_SAVE filter isn't added to fix up after the request.


* modules/cache/cache_storage.c

  (cache_select_url): Add more debug output.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@157162 13f79535-47bb-0310-9956-ffa450edef68
2005-03-11 21:39:45 +00:00
Sander Striker
c70cb4ba14 More mod_cache tweakage...
* modules/cache/mod_cache.c

  (cache_save_filter): Instead of unconditionally returning a 304 when
   the original request was conditional and we issued a cache revalidating
   request, handle the request as if it came in while our cache was
   still valid.


* modules/cache/cache_storage.c

  (cache_select_url): Strip off the conditional headers from the original
   request, prior to adding our own for the purpose of revalidating our
   cached response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156330 13f79535-47bb-0310-9956-ffa450edef68
2005-03-06 18:57:22 +00:00
Joe Orton
519b48fce1 * modules/cache/mod_disk_cache.c (store_body): Fix format string
warnings; print integers using _FMT strings.

* modules/cache/cache_util.c (ap_cache_check_freshness): Remove unused
variable.

* modules/cache/cache_storage.c (cache_select_url): Remove unused
variable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153385 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:16:06 +00:00