1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-26 19:01:35 +03:00
Commit Graph

42 Commits

Author SHA1 Message Date
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Bill Stoddard
8ef1d7f01e Fix check for APR feature
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93996 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 15:45:46 +00:00
Cliff Woolley
55d4960f3a Get mod_mem_cache to compile cleanly again on linux, where apr_atomic_t
is a struct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93995 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 06:37:32 +00:00
Cliff Woolley
1e54774af1 Hacks on top of hacks... UNIX needs unistd.h for the close() prototype
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93993 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 05:22:37 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Bill Stoddard
ca79431488 Remove incomplete cache_objects from the cache if the cache update fails. This
fixes a bug where the cache was referencing freed cache_objects.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93903 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 13:56:20 +00:00
Bill Stoddard
3b5e58ba6e Enable mod_mem_cache to use apr_atomic operators in managing cache_object
reference counting. Enabled by default via the USE_ATOMICS preproc directive.
This compiles cleanly and serves pages on Windows. Not compiled or tested on
any other OS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93889 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 03:59:21 +00:00
Bill Stoddard
ee42c383b1 A bit more cleanup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93888 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 03:00:22 +00:00
Bill Stoddard
1eddc44767 cleanup some code paths
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93880 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 22:26:07 +00:00
Bill Stoddard
fcc65d9d3b Remove some deprecated comments. Delete some unused variables.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93876 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 22:05:21 +00:00
Bill Stoddard
9534321221 Reference the cache_object directly rather than via the handle
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93850 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 03:00:35 +00:00
Bill Stoddard
1172ca6458 Move refcount and cleanup to the primary cache object (these fields can now
be used implementations other than mod_mem_cache)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93849 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 02:54:25 +00:00
Bill Stoddard
e0530c48a6 No this is not a pretty site... close the cached file descriptor. There is no clean
way to get this back into an apr_file_t since we are in the request pool cleanup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93806 13f79535-47bb-0310-9956-ffa450edef68
2002-03-08 21:59:25 +00:00
Bill Stoddard
aca5bdee8e Add file handle caching to mod_mem_cache. This is still experimental and
is enabled by the #define CACHE_FD, which is off by default.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93789 13f79535-47bb-0310-9956-ffa450edef68
2002-03-08 04:25:30 +00:00
Bill Stoddard
33d246241a Deconstify...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93782 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 22:48:37 +00:00
Bill Stoddard
228d7cd938 Alignment tweaks. No function change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93779 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 22:26:33 +00:00
Bill Stoddard
5e0e6c4336 Change the return type on read_headers, write_headers, read_body and write_body.
Sanitize some of the return codes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93777 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 22:13:15 +00:00
Bill Stoddard
ec5ec9665f Do a better job of cleaning up (plug memory leaks) and handling aborted
cache updates. We really need a better way to allocate cache_objects.
Making WAY too many malloc/calloc calls...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93775 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 21:44:49 +00:00
Bill Stoddard
77bf9d14e0 Track cache size as items are added to and removed from the cache
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93772 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 19:27:58 +00:00
Bill Stoddard
c9ca452fa4 Place some limits on the size of the cache and the number of objects that can be
placed in the cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93771 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 19:21:56 +00:00
Bill Stoddard
793eb2217c Add a comment...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93768 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 15:16:25 +00:00
Bill Stoddard
7abb83cc31 Add CacheMinObjectSize and CacheMaxObjectSize directives to mod_mem_cache
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93763 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 14:55:10 +00:00
Bill Stoddard
d8439c861f Add a reference counter to the mem_cache_object_t and code to
manage deleting the cache_object after the reference count
drops to 0. Not fully tested yet..


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93439 13f79535-47bb-0310-9956-ffa450edef68
2002-02-15 22:26:35 +00:00
Ian Holsman
13b7646745 another race condition.
also.. changed the logic slightly.
it will remove the name retrieved, not what the object has.

sorry for the spam.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93380 13f79535-47bb-0310-9956-ffa450edef68
2002-02-12 23:13:53 +00:00
Ian Holsman
a04f6402b2 once more with feeling
obj was set before the mutex so someone could have came and updated h->cache_obj
between us setting obj, and useing it.
running now for 10 minutes without core (a record!)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93379 13f79535-47bb-0310-9956-ffa450edef68
2002-02-12 22:54:16 +00:00
Ian Holsman
e5d12da5a0 fix a race condition.
2 threads both trying to remove the same URL at the same time.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93378 13f79535-47bb-0310-9956-ffa450edef68
2002-02-12 22:11:30 +00:00
Bill Stoddard
db91e13b5f mod_disk_cache cleanup. Pass request_rec on the open_entity call.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93207 13f79535-47bb-0310-9956-ffa450edef68
2002-02-03 19:04:15 +00:00
Bill Stoddard
1d5a371a5c Support files for mod_disk_cache. Some tweaks to arguments on various hook
calls. Still lots of cleanup work to do here...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93196 13f79535-47bb-0310-9956-ffa450edef68
2002-02-03 06:24:55 +00:00
Jeff Trawick
a3326b129e get mod_mem_cache to compile with compilers that bother to check for
Function argument assignment between types "int*" and "long*"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93034 13f79535-47bb-0310-9956-ffa450edef68
2002-01-26 12:39:49 +00:00
Ian Holsman
eca473b0c0 I haven't created the optional function to specify the cache_key yet,
That will come after this patch.

ok.. brief summary of whats changed

* new Optional Directives
	* CacheMemEntrySize -- max size of a individual entry in memory
		cache
	* CacheIgnoreNoLastMod - so we can cache mod-included files

* it tries to figure out the size of the request based on buckets if the
	content-length header isn't set

* mem_cache now caches the subprocess_env & notes tables
* the CACHE_IN/OUT/CONDITIONAL run at FTYPE_CONTENT+1, so that
	all other content filters run BEFORE the cache in.

note: the code is still experimental, and we need a bit more work
mainly...
* garbage collection
* cache stats/reporting
* manual removal of a key.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93030 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 20:09:33 +00:00
Ian Holsman
59c3015f6b cache now can cache things for minutes.
add remove_entity function to type on mem_cache (so we can remove items from the cache)
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92734 13f79535-47bb-0310-9956-ffa450edef68
2002-01-04 17:58:36 +00:00
Jeff Trawick
dc9823dcb8 if compilation is doomed due to lack of thread support, fail
the compile with a nicer message

(hopefully this is only temporary?)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92338 13f79535-47bb-0310-9956-ffa450edef68
2001-12-05 15:01:15 +00:00
Aaron Bannert
bbc39ab17d It compiles and looks good. I know not of a good way to test this,
but nobody spoke up on the list, so I'm just going to commit it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92060 13f79535-47bb-0310-9956-ffa450edef68
2001-11-20 22:19:19 +00:00
Bill Stoddard
7fd63fb064 Maintain info structure in mod_mem_cache. This fixes bug where the content
type was lost when content was put in the cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91005 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 17:41:05 +00:00
Jeff Trawick
7ed1085657 fix a typo which prevented mod_mem_cache from compiling with
AP_DEBUG_ASSERT() enabled


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91001 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 11:19:23 +00:00
Bill Stoddard
dbfc30e197 Introduce the notion of a multi part cache object. Part of the cache_object
is common across any cache implementation, the other part is private to
the particular implementation (eg, mem_cache_object_t/mod_mem_cache).
Use a cache_handle_t allocated out of the request pool to hold references
to the callback functions and common cache object.

The cache_handle_t contains implementation specific callback functions and
a reference to a common cache_object_t.  The cache_object_t contains
a reference to an implementation specific cache object extension (mem_cache_object_t
for example).

All this simplifies managing the callback function pointers (don't want to
save them in each cache entry) and collections of cache_object_t keyed
to a single url.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90994 13f79535-47bb-0310-9956-ffa450edef68
2001-09-10 18:09:56 +00:00
Bill Stoddard
b2d20857c6 Pass headers on read/write header calls. Update mod_mem_cache to cache headers.
So much to do so little time ...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90947 13f79535-47bb-0310-9956-ffa450edef68
2001-09-07 02:56:11 +00:00
Bill Stoddard
3823232674 Three small changes...
1. Change CACHE_TYPE_MALLOC to CACHE_TYPE_HEAP
2. Enable cacheing content contained in multiple brigades
3. Don't cache an entry more than once.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90792 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 02:49:40 +00:00
Bill Stoddard
3c97baefef Eliminate a cache_handle leak. cache_handle is now allocated out of the
request pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90637 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 17:01:21 +00:00
Jeff Trawick
f0411d97ed mod_mem_cache
allow it to be enabled

don't segfault if we don't have/need a lock

clear up several compile warnings


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90634 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 16:46:43 +00:00
Bill Stoddard
e04da4c18a Cleanup a few compile warnings...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90632 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 15:15:57 +00:00
Bill Stoddard
c1bce71562 Experimental cache based on Graham Leggett's layered cache design. mod_cache
implements a quick handler, and three filters. The filters are
CACHE_IN for loading the cache, CACHE_OUT for serving content out of the cache
and CACHE_CONDITIONAL, which handles stale entries in the cache.

mod_cache implements code that makes RFC compliant caching decisions. It
interfaces with the actual storage mechanism via calls to functions defined in
cache_storage.c.  This commit includes a simple in memory (malloc'ed memory)
cache implementation that demonstrates autoloading and serving files
keyed on URL.

This is not even close to production ready. You have been warned :-)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90549 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 14:15:00 +00:00