1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

299 Commits

Author SHA1 Message Date
Joe Orton
b078f2374e * include/ap_socache.h: Define AP_SOCACHE_DEFAULT_PROVIDER as a
default provider name, to allow consumers to use a default provider
  if not configured otherwise.

* modules/cache/mod_socache_shmcb.c (register_hooks): Register shmcb
  as the default provider.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724723 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 14:52:59 +00:00
Joe Orton
dce91079c1 Reduce config overhead for use of socache interface by allowing
default paths to be used if none are configured:

* include/ap_socache.h (ap_socache_provider_t::create):
  Allow arg to be NULL to force use of defaults.
  (ap_socache_provider_t::init): Rename 'namespace' parameter to
  'cname' and restrict to allow use in filesystem paths.
  
* modules/cache/mod_socache_dbm.c (socache_dbm_create, 
  socache_dbm_init),
  modules/cache/mod_socache_shmcb.c (socache_shmcb_create, 
  socache_shmcb_init): 
  Default to use of runtimedir-relative paths if no
  explicit path is configured.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724682 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 13:11:45 +00:00
Paul Querna
24f396ce76 When an expires or cache-control header are sent, the RFC does allow us to cache normally non-cacheable response statuses.
Submitted by: Alex Polvi <alex polvi.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724093 13f79535-47bb-0310-9956-ffa450edef68
2008-12-07 06:33:02 +00:00
Paul Querna
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
Ruediger Pluem
55b00a33b0 * mod_mem_cache is dead. So remove all hints on it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711576 13f79535-47bb-0310-9956-ffa450edef68
2008-11-05 14:41:02 +00:00
William A. Rowe Jr
40cb414ae6 The mem_cache is dead, long live disk_cache.
Reviewed by: wrowe, sander, fielding, abida, pquerna, jesus, lars

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711470 13f79535-47bb-0310-9956-ffa450edef68
2008-11-04 23:26:14 +00:00
Paul Querna
e1e0efeac8 * modules/cache/mod_socache_dbm.c
(socache_dbm_init) Use AP_NEED_SET_MUTEX_PERMS to determine when we need to
    set the file permissions on the created DBM files, rather than listing 
    a hodgepodge of operating systems by hand.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708067 13f79535-47bb-0310-9956-ffa450edef68
2008-10-27 00:43:45 +00:00
Paul Querna
409a8921e3 * modules/cache/mod_socache_dbm.c: Fix compile by including unixd.h on operating
systems that need it, which is required for for the use of unixd_config
    inside socache_dbm_init.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708066 13f79535-47bb-0310-9956-ffa450edef68
2008-10-27 00:40:36 +00:00
William A. Rowe Jr
1ed653d36a Catch up with a host of changes to the current module set
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664240 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 02:10:32 +00:00
William A. Rowe Jr
c14c55d543 Signedness error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664239 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 02:04:41 +00:00
William A. Rowe Jr
6f0e96cfbc ap_ namespace, a dead giveaway that this information should reside
in the general include\ directory

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664232 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 01:13:10 +00:00
William A. Rowe Jr
05e2e1ae85 The cache_hash, cache_pqueue and cache_cache functions
are undecorated, their .h files are not propagated into
an installed include/ tree, and were erroniously exported.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664145 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 21:47:08 +00:00
William A. Rowe Jr
87c353a5c0 mod_mem_cache consumes mod_cache, linking this in
two modules is an error.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664143 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 21:45:09 +00:00
William A. Rowe Jr
7158876aaf Revert prior commit; the flaw is not in exporting all
of these cache_* functions, but in declaring them 
exported in the first place.  _hash, _pqueue and cache_cache
are undecorated and were erroniously exported.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664142 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 21:44:25 +00:00
William A. Rowe Jr
0f1189fc9b These are declared CACHE_DECLARE and should be consumed
from mod_cache by mod_mem_cache.  The duplicate cache_util
import is a dead giveaway that this was broken.

In order to backport, an MMN bump would be required because
these cache_pqueue, cache_cache and cache_hash exported
functions would be added to the "contract" of functions
which are available from mod_cache for third party cache
providers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664136 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 21:23:05 +00:00
Bradley Nicholes
48143c51d5 Add new exports
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@659643 13f79535-47bb-0310-9956-ffa450edef68
2008-05-23 19:52:03 +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
aa35cf17c2 Centralize hop-by-hop header handling in the main mod_cache code. This change is a no-op -- i.e. we call the same code path as prior to the API renaming. However this is propably wrong; and we should have been cleansing the content-types all along
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649179 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:40:10 +00:00
Dirk-Willem van Gulik
0701f89d30 Centralize hop-by-hop header handling in the memory caching code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649178 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:38:36 +00:00
Dirk-Willem van Gulik
a0561f4c05 Centralize hop-by-hop header handling in the disk caching code. Note that 'out' now has actual out semantics; hence the change in headers_in.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649176 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:37:24 +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
Chris Darroch
719bf72489 remove const on socache module declarations to avoid segfault in
ap_setup_prelinked_modules() when modules linked in at compile time


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@648499 13f79535-47bb-0310-9956-ffa450edef68
2008-04-16 04:02:57 +00:00
Chris Darroch
76e9c2b0ba Fix socache modules' APACHE_MODULE() definitions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646945 13f79535-47bb-0310-9956-ffa450edef68
2008-04-10 20:24:42 +00:00
Joe Orton
14972fdb0d * modules/cache/ap_socache.h: Doxify.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646415 13f79535-47bb-0310-9956-ffa450edef68
2008-04-09 16:13:02 +00:00
Guenter Knauf
cf462757db oops - checked in wrong makefile.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646182 13f79535-47bb-0310-9956-ffa450edef68
2008-04-09 02:45:08 +00:00
Guenter Knauf
77f9db943d added new chache modules to NetWare build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646177 13f79535-47bb-0310-9956-ffa450edef68
2008-04-09 02:01:27 +00:00
Joe Orton
bd632a3388 * modules/cache/mod_socache_dbm.c: Fix some dodgy formatting, thanks rpluem.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645984 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 16:04:12 +00:00
Joe Orton
2e2731f3f9 Adjust socache init interface to take sizing hints, and namespace tag
for memcache:

* modules/cache/ap_socache.h (struct ap_socache_hints): New structure.
  Change init callback to take namespace string and hints structure pointer.

* modules/cache/mod_socache_dc.c (socache_dc_init): Adjust accordingly.

* modules/cache/mod_socache_dbm.c (struct ap_socache_instance_t): Rename
  timeout field to expiry_interval.
  (socache_dbm_init, socache_dbm_create): Take expiry interval from
  hints rather than hard-code to 30.
  (socache_dbm_expire): Update for timeout field rename.

* modules/cache/mod_socache_shmcb.c (socache_shmcb_init): Adjust for
  hints and namespace; adjust subcache index sizing heuristics to use
  passed-in hints.

* modules/cache/mod_socache_memcache.c (struct ap_socache_instance_t):
  Add tag, taglen fields.
  (socache_mc_init): Store the passed-in namespace in instance
  structure.
  (mc_session_id2sz): Adjust to not take context, use configured
  tag as string prefix, and not use a return value.
  (socache_mc_store, socache_mc_retrieve, socache_mc_remove):
  Adjust for mc_session_id2sz interface changes.

* modules/ssl/ssl_scache.c (ssl_scache_init): Pass namespace and hints
  to socache provider init function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645978 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 15:47:48 +00:00
Joe Orton
39bb462ea8 * modules/cache/ap_socache.h: Add ap_socache_instance_t object type.
Adjust the provider interface to use this instance type throughout.

* modules/cache/mod_socache_dbm.c,
  modules/cache/mod_socache_memcache.c,
  modules/cache/mod_socache_shmcb.c,
  modules/cache/mod_socache_dc.c: Adjust all implementations to 
  define the instance object in place of the "struct context", and
  to take this object directly in the provider interface.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645924 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 13:49:52 +00:00
Joe Orton
3279936028 Session cache interface redesign, Part 8:
Abstract out the mod_ssl session caching interface into a separate set
of modules, mod_socache_*.

* modules/cache/ap_socache.h: New file.

* modules/cache/config.m4: Copy CHECK_DISTCACHE from ../ssl/config.m4; 
  add new socache modules.

* modules/cache/mod_socache_dbm.c: Copied from ../ssl/ssl_scache_dbm.c.
  s/ssl_scache_/socache_/; add module structure and register_hooks.

* modules/cache/mod_socache_shmcb.c: Copied from ../ssl/ssl_scache_shmcb.c.
  s/ssl_scache_/socache_/; add module structure and register_hooks.
  Add SHMCB_MAX_SIZE definition, replacing APR_SHM_MAXSIZE.

* modules/cache/mod_socache_memcache.c: Copied from
  ../ssl/ssl_scache_memcache.c.
  s/ssl_scache_/socache_/; add module structure and register_hooks.
  Enable for APR-Util 1.3.x at compile-time, omitting configure-time
  checks.

* modules/cache/mod_socache_dc.c: Copied from ../ssl/ssl_scache_dc.c.
  s/ssl_scache_/socache_/; add module structure and register_hooks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645844 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 10:47:04 +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
e858f16bfb * Restore the original request headers if the cached resource was stale, as they
may be needed by further output filters like the byterange filter to make the
  correct decisions.

PR: 44579


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636386 13f79535-47bb-0310-9956-ffa450edef68
2008-03-12 16:07:46 +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
Dirk-Willem van Gulik
dca366b400 Incorperate feedback of Rudiger.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@620610 13f79535-47bb-0310-9956-ffa450edef68
2008-02-11 21:06:58 +00:00
Dirk-Willem van Gulik
813b31560b Turn the cache module into first class citizens (well the disk_cache
and file cache that is).

This makes the delta between 'all' and 'most'

mod_cern_meta.c
mod_log_forensic.c
mod_mime_magic.c
mod_unique_id.c
mod_usertrack.c
mod_version.c
mod_mem_cache.c

And keeps disabled in all and most the modules for:
	
authnz_ldap
bucketeer
echo
example_hooks
case_filter
case_filter_in
example_ipc
charset_lite
cgid
ldap
optional_hook_export
optional_hook_import
optional_fn_import
optional_fn_export

As well as mod_ssl which is intentionally not part of MOST and All.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@620530 13f79535-47bb-0310-9956-ffa450edef68
2008-02-11 17:21:05 +00:00
Dirk-Willem van Gulik
6f50e36657 Return a little bit more error information when, say a disk is full or something gets write protected. Note that in some cases mod_cache.c will_also_ log a 'cache: store_headers failed' subsequently.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@620489 13f79535-47bb-0310-9956-ffa450edef68
2008-02-11 14:27:34 +00:00
Ruediger Pluem
deec7859b2 * Change loglevel from ERROR to WARNING if the renaming of the vary, headers
or data file fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607440 13f79535-47bb-0310-9956-ffa450edef68
2007-12-29 16:19:51 +00:00
Ruediger Pluem
c8dd361906 * Make loglevel consistent for similar situations. As this really should not
happen set it to error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607245 13f79535-47bb-0310-9956-ffa450edef68
2007-12-28 14:16:35 +00:00
Nick Kew
e5061abc93 Multiple trivial fixes from Christophe JAILLET
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557837 13f79535-47bb-0310-9956-ffa450edef68
2007-07-20 01:26:55 +00:00
Eric Covener
9a29cd5f65 SECURITY: CVE-2007-1862 (cve.mitre.org)
mod_mem_cache: Copy headers into longer lived storage; header names and
values could previously point to cleaned up storage

PR: 41551
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@543515 13f79535-47bb-0310-9956-ffa450edef68
2007-06-01 15:50:12 +00:00
Justin Erenkrantz
3019f9a87b mod_cache: Do not set Date or Expires when they are missing from the original
response or are invalid.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539621 13f79535-47bb-0310-9956-ffa450edef68
2007-05-18 22:42:59 +00:00
Justin Erenkrantz
cd208845d6 mod_cache: Correctly handle HEAD requests on expired cache content. PR 41230.
* modules/cache/mod_cache.c
  (cache_save_filter): Properly handle HEAD responses when we have a stale handle.

(This patch was revised by Justin/Ruediger.)

Submitted by: Niklas Edmundsson
Reviewed by: Justin, Ruediger


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539620 13f79535-47bb-0310-9956-ffa450edef68
2007-05-18 22:38:08 +00:00
Justin Erenkrantz
1b7508dd21 mod_cache: Let Cache-Control max-age set the expiration of the cached
representation if Expires is not set.

* modules/cache/mod_cache.c
  (cache_save_filter): If Cache-Control max-age is set and Expires isn't,
  let that value control our expiration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539063 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 18:25:13 +00:00
Justin Erenkrantz
c795f75fea mod_disk_cache: If the Vary'd content is stale, we can handle it via our
freshness tests which will attempt to revalidate the content.

* modules/cache/mod_disk_cache.c
  (open_entity): If the root Vary index is stale, we don't need to throw away
  potentially stale content - we can try to refresh it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539054 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 18:17:23 +00:00