1
0
mirror of https://github.com/apache/httpd.git synced 2025-04-26 12:28:56 +03:00

93 Commits

Author SHA1 Message Date
Stefan Fritsch
5604942f8f remove unused variables
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992809 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:56:10 +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
Stefan Fritsch
f6af484cea Pass the huge apr_uri_t structs by reference instead of by value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982012 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:39:03 +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
Ruediger Pluem
b82a2f2829 * According to RFC2616 13.2.3 1. negative results of age calculations should
be replaced by zero.

Reported by: Ryujiro Shibuya <rshibuya gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933886 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 08:57:18 +00:00
Graham Leggett
a922151440 Style fixes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821539 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:24:46 +00:00
Graham Leggett
a2bb3c8022 Remove the server_rec wired into uri_meets_conditions, the debugging
statements that required it were removed in the past, so wiring through
server_rec is no longer necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821538 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:21:25 +00:00
Graham Leggett
050515d99f mod_cache: Fix uri_meets_conditions() so that CacheEnable will
match by scheme, or by a wildcarded hostname.
PR: 40169
Submitted by: Peter Grandi <pg_asf asf.for.sabi.co.uk>
Reviewed by: Graham Leggett


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821333 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 14:54:00 +00:00
Graham Leggett
383a108c07 Add suggested parentheses around APR_STATUS_IS_ENOENT.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809665 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 17:11:27 +00:00
Guenter Knauf
17d2895c44 moved "finfo.mtime = 0;" after var declaration;
removed tab.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809440 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 00:22:44 +00:00
William A. Rowe Jr
23a2ebfd33 Add parenthesis for legibility and correcting association,
and axe an unused variable


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808723 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:31:23 +00:00
Graham Leggett
fd5c214124 Make sure when adding a warning, that we don't duplicate an existing warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808656 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:57:27 +00:00
Graham Leggett
2e32dbe9b5 When attempting to set the stale lock, we will pass try_lock twice. If we
already have the lock the first time, we must also have the lock the second
time.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808649 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:44:48 +00:00
Graham Leggett
9bf71872c9 Reintroduce an optimisation lost in some cut and paste. The cache lock
is removed as soon as we see an EOS, or is removed immediately if a
failure has occurred.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808220 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 23:22:18 +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
8433cdfe67 * Correctly save Content-Encoding of cachable entity.
PR: 46401
Submitted by: Dan Poirier <poirier pobox.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726796 13f79535-47bb-0310-9956-ffa450edef68
2008-12-15 20:45:29 +00:00
Ruediger Pluem
6c1424b8d2 * We need to use the headers_out table we merged above, not the original one.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649793 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:25:16 +00:00
Ruediger Pluem
bed15a9a7f * Style fixes. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649792 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:15:14 +00:00
Ruediger Pluem
907b78b12d * Use the correct headers_out table for overlaying.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649791 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:13:34 +00:00
Dirk-Willem van Gulik
b3c481970a Centralize the error-header collapsing done when sending out cached replies. Mark the change in CHANGES as it may have unforseen fall out and/or may need to be reverted or done more subtle.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649460 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 11:05:25 +00:00
Martin Kraemer
a9091bba7f Make it compile on pre-C99 compilers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649446 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 10:06:20 +00:00
Ruediger Pluem
e1ae2aa551 * Style police. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649228 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 18:48:18 +00:00
Dirk-Willem van Gulik
53d475f654 Currently each of the caching module includes logic to implement
the hop-by-hop rules of rfc 2616 along with the entity response
rules. To make sure that they stay in sync; and to make it easier
to add (http) caching modules - this change moves them all into
one place (cache_util) and exposes a in-bound and out-bound
version to operate on the headers.

In short: we retire ap_cache_cacheable_hdrs_out() which was used
for both in- and out-put headers; and replace it by a single
ap_cache_cacheable_headers() which understands the hop-by-hop
rules. And then wrap this into an in- and out-put specific 
ap_cache_cacheable_headers_in()/out() which we can teach things
about entity responses and so on.. The latter which will also 
merge error and ensure content-type. 

This API change bumps up the minor MM by one.    



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649162 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:03:13 +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
00cd3798d1 * If the cached entity contained Cache-Control: no-cache, treat it as stale
causing revalidation.

PR: 44511


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@632749 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 12:35:33 +00:00
Ruediger Pluem
6ad514ccc1 * Prevent a segmentation fault if one of the Cache-Control headers
s-maxage, max-age, min-fresh, max-stale has no value assigned.
  In this case ignore s-maxage, max-age, min-fresh. For max-stale
  it is valid to set no value. In this case set max-stale to 1 year
  to signal that the client is accepting a stale response of any age.

Submitted by: Niklas Edmundsson <nikke acc.umu.se>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535617 13f79535-47bb-0310-9956-ffa450edef68
2007-05-06 14:35:02 +00:00
Graham Leggett
d010f24449 mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
authority component and an empty path, the empty path is to be equivalent
to "/". It explicitly cites the following four URIs as equivalents:
  http://example.com
  http://example.com/
  http://example.com:/
  http://example.com:80/


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450063 13f79535-47bb-0310-9956-ffa450edef68
2006-09-26 14:36:43 +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
a8482b67cf * info->expire and info->date are in microseconds. So convert the difference
to seconds before comparing it to age which is in seconds.

PR: 39713
Submitted by: Owen Taylor <otaylor redhat.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@411464 13f79535-47bb-0310-9956-ffa450edef68
2006-06-03 19:41:49 +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
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
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Colm MacCarthaigh
d7bd8dbda1 Two minor whitespace cleanups. Syncs with the 2.2.x branch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@293291 13f79535-47bb-0310-9956-ffa450edef68
2005-10-03 10:30:52 +00:00
Colm MacCarthaigh
acf227a492 Enhance CacheEnable/CacheDisable to control caching on a per-protocol, per-host
and per-path basis. Makes Cache(En|Dis)able useful for forward proxy servers.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239421 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 15:43:23 +00:00
Paul Querna
85015ced14 'generate_name' is too generic to be in the public symbols. Rename it to ap_cache_generate_name. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@179877 13f79535-47bb-0310-9956-ffa450edef68
2005-06-03 20:19:08 +00:00
Sander Striker
7402943941 Make IgnoreCacheControl do what it implies when it comes to requests and
freshness checks.

* modules/cache/cache_util.c

  (ap_cache_check_freshness): Ignore CacheControl: max-age and min-fresh
   if IgnoreCacheControl is set.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156567 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 21:11:07 +00:00
Sander Striker
f92cbd8dbc Improve caching a bit more...
* modules/cache/cache_util.c

  (ap_cache_check_freshness): On Cache-Control/Pragma no-cache force
   revalidation by marking the resource as stale.  Unless IgnoreCacheControl
   is set ofcourse.

 
* modules/cache/mod_cache.c

  (cache_url_handler): Remove Cache-Control/Pragma no-cache check and
   accompagnying comment.

  (cache_save_filter): Move FIXME comment to the correct location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156480 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 02:35:50 +00:00
Sander Striker
c8c8263f9c Remove an unused function.
* cache_util.c
* mod_cache.imp
* mod_cache.h

  (ap_cache_request_is_conditional): Removed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156471 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 01:34:32 +00:00
Justin Erenkrantz
a32a693014 * modules/cache/cache_util.c (ap_cache_check_freshness): Use r->headers_in not
the stored headers for the Cache-Control check.

Pointed out by: Sander Striker


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156401 13f79535-47bb-0310-9956-ffa450edef68
2005-03-07 07:18:34 +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
Justin Erenkrantz
1d4c6d1c6d Cleanup structures in mod_cache and friends to remove unused or unnecessary
fields.  Also resolves a number of latent bugs due to the wrong fields being
accessed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152679 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 17:39:56 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Justin Erenkrantz
63dd4623e1 At long last, promote mod_cache and friends out of experimental/.
Also, take quick pass through docs files to remove experimental label for them.

Reviewed by: Paul Querna, Bill Stoddard, Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106737 13f79535-47bb-0310-9956-ffa450edef68
2004-11-27 19:06:48 +00:00