1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

596 Commits

Author SHA1 Message Date
Graham Leggett
1aeb087542 mod_disk_cache: Change on-disk header file format to support the
link of the device/inode of the data file to the matching header
file, and to support the option of not writing a data file when
the data file is empty. Refactor the mod_disk_cache code so that
headers are written as late as possible (on commit), allowing the
device and inode of the body to be written to the header. At this
point, writes to the cache are now atomic, without locks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002643 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 14:17:52 +00:00
Graham Leggett
5059403b56 mod_cache: Make sure that we never allow a 304 Not Modified response
that we asked for to leak to the client should the 304 response be
uncacheable. PR45341


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001884 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 19:28:40 +00:00
Jeff Trawick
aa0f1075bb axe extra ";", fixing this messages from Sun Studio:
warning: syntax error:  empty declaration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001864 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 18:41:33 +00:00
Graham Leggett
61b7c8574b mod_cache: Add the cache_status hook to register the final cache
decision hit/miss/revalidate. Add optional support for an X-Cache
and/or an X-Cache-Detail header to add the cache status to the
response. PR48241


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001639 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 09:20:40 +00:00
Guenter Knauf
53ecdfd1c0 Fixed NetWare import/export list for cache modules.
Reported by normw AT gknw.net.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000761 13f79535-47bb-0310-9956-ffa450edef68
2010-09-24 08:49:49 +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
18a8c46a59 Move mod_cache-private includes and defines from the public mod_cache.h
interface into the private cache_util.h interface.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000249 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 21:55:27 +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
7e215375d2 Trim legacy structure from removed mod_mem_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000160 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:56:06 +00:00
Graham Leggett
f427138d29 Remove deprecated ap_cache_cacheable_hdrs_out.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000159 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:52:25 +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
William A. Rowe Jr
9baaf4e800 Revert breakage in 2.2.4 introduced in r450055, by offering a CacheStoreExpired
directive to allow the user to override this questionable change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000106 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 17:54:39 +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
20235c3937 Update mod_disk_cache to comply with the new create_entity() interface.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999678 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 22:47:14 +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
edb04a3c9f No need to call the cleanup in the forked-child case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997676 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 10:08:18 +00:00
Graham Leggett
d3f17c03b1 Ensure the return value is initialised.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997664 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 09:56:38 +00:00
Graham Leggett
ca9d2ae938 mod_cache: Add a discrete commit_entity() provider function within the
mod_cache provider interface which is called to indicate to the
provider that caching is complete, giving the provider the opportunity
to commit temporary files permanently to the cache in an atomic
fashion. Move all "rename" functionality of temporary files to permanent
files within mod_disk_cache from ad hoc locations in the code to the
commit_entity() function. Instead of reusing the same variables for
temporary file handling in mod_disk_cache, introduce separate discrete
structures for each of the three cache file types, the headers file,
vary file and data file, so that the atomic rename of all three file
types within commit_entity() becomes possible. Replace the inconsistent
use of error cleanups with a formal set of pool cleanups attached to
a subpool, which is destroyed on error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997545 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 00:05:14 +00:00
Graham Leggett
721d19a58b Handle the case where a brigade might have buckets following the eos
bucket. In this case the cache provider passes all buckets through as
is once the cached entry is marked as done.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@996713 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 22:35:51 +00:00
Graham Leggett
665426645e mod_cache: Change the signature of the store_body() provider function
within the mod_cache provider interface to support an "in" brigade
and an "out" brigade instead of just a single input brigade. This
gives a cache provider the option to consume only part of the brigade
passed to it, rather than the whole brigade as was required before.
This fixes an out of memory and a request timeout condition that would
occur when the original document was a large file. Update the
mod_disk_cache provider implementation to take into account the new API.
Introduce CacheReadSize and CacheReadTime directives to mod_disk_cache
to control the amount of data to attempt to cache before sending the
data on to the client in the "out" brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@996395 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 23:16:49 +00:00
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
Stefan Fritsch
a0e0e585b0 Disable sendfile by default, as discussed at
http://mail-archives.apache.org/mod_mbox/httpd-dev/201007.mbox/<4C4355EE.2060605@rowe-clan.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992689 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 21:53:06 +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
Stefan Fritsch
aa576071af - Remove a load of unused variables (or variables that are set but never read).
- Move some declarations into the correct #ifdef scope.

I couldn't compile/test netware, but the changes look obvious enough.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:45:21 +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
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
William A. Rowe Jr
2fc7e07cb1 Clean iterator call syntax
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960075 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02 18:02:51 +00:00
William A. Rowe Jr
de541c9184 Fix nasty dbm bug that wasn't expiring records; time() doesn't return apr_time_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960074 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02 18:02:27 +00:00
William A. Rowe Jr
661afad48c Clean shmcb iterator call syntax and return value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960073 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02 18:00:26 +00:00
Stefan Fritsch
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
William A. Rowe Jr
5740b5cfd9 Introduce an socache iterator 'userctx' for the user to track the
context of their own callback.

Breaks API, but we probably wanted an mmn reset between .6 and .7
betas for unintentional/unnoticed ABI breaks.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@958157 13f79535-47bb-0310-9956-ffa450edef68
2010-06-26 00:26:01 +00:00
William A. Rowe Jr
6782a1f9fe Iterator implementations welcome, although mod_socache_memcache will
never gain one, per documentation in the memcached FAQ.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@958093 13f79535-47bb-0310-9956-ffa450edef68
2010-06-25 19:22:48 +00:00
William A. Rowe Jr
7a6e700e43 Tally replacements seperately from new-stores. Of course the actual
replacement logic doesn't work terribly well right now, as discussed
on list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@958092 13f79535-47bb-0310-9956-ffa450edef68
2010-06-25 19:21:30 +00:00
Nick Kew
f877509b61 Fix return values from socache modules when a key is not found in cache
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@957235 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 15:04:57 +00:00
Brian Havard
8a47421de6 OS/2: Fix building of more modules that depend on symbols from other modules.
Affected modules are: mod_heartbeat, mod_session_cookie, mod_session_crypto,
mod_session_dbd and mod_disk_cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956857 13f79535-47bb-0310-9956-ffa450edef68
2010-06-22 11:57:51 +00:00
Stefan Fritsch
9b851ec65e - Add reallyall option to configure to build everything that can be built with
the available libs.
- Remove redundant --with-distcache option. Simply enable distcache if
  mod_socache_dc is selected.
- Enable serf support by default if serf is available in /usr.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956221 13f79535-47bb-0310-9956-ffa450edef68
2010-06-19 12:36:57 +00:00
Graham Leggett
a71d310a23 mod_cache: Explicitly allow cache implementations to cache a 206 Partial
Response if they so choose to do so. Previously an attempt to cache a 206
was arbitrarily allowed if the response contained an Expires or
Cache-Control header, and arbitrarily denied if both headers were missing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952823 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 21:13:06 +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
Graham Leggett
fd646c8e2b mod_disk_cache: Decline the opportunity to cache if the response is
a 206 Partial Content. This stops a reverse proxied partial response
from becoming cached, and then being served in subsequent responses.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951222 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 00:17:16 +00:00
Graham Leggett
2e958275d9 Fix a bug where if the cache quick handler is switched off, and the CACHE
filter is manually added by the admin, but caching has not been enabled for
the URL space, an attempt is made to remove the CACHE_SAVE filter instead
of the CACHE filter. This fix makes the code work like the comment above
the code, the comment being correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951220 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 00:09:51 +00:00
Ruediger Pluem
8fa54a82f4 * Do NOT cache 206 responses in any case since we don't (yet) know how to
cache partial responses. Fixes regression of r724093.

PR: 49113


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933919 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 12:00:11 +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
Jim Jagielski
f90bc4f900 Align "hidden" function names with external... picky, but
less confusing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@923791 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 15:01:55 +00:00
Jeff Trawick
2052575a36 fix these warnings (and presumably a similar one in mod_socache_dc.c):
mod_socache_shmcb.c:625: warning: no previous prototype for ‘socache_shmcb_iterate’
mod_socache_dbm.c:505: warning: no previous prototype for ‘socache_dbm_iterate’
mod_socache_memcache.c:290: warning: no previous prototype for ‘socache_mc_iterate’


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@918655 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 19:32:58 +00:00
William A. Rowe Jr
2098898eb1 in preparation of fixing 2.2 branch, change again, now to a cast-less solution
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@917611 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01 17:54:15 +00:00
Ruediger Pluem
d0b18c8e45 * Silence compiler warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@911528 13f79535-47bb-0310-9956-ffa450edef68
2010-02-18 18:59:26 +00:00
Jeff Trawick
7dea349012 fix additional use of "session" terminology, following r907917
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@908168 13f79535-47bb-0310-9956-ffa450edef68
2010-02-09 19:34:51 +00:00