Jeff Trawick [Tue, 29 Jan 2002 04:54:05 +0000 (04:54 +0000)]
Don't let the default handler try to serve a raw directory. At
best you get gibberish. Much worse things can happen depending
on the OS.
This can happen when autoindex isn't loaded.
On AIX, I had a directory file which was reported to be 1536 bytes
in size. mmap() failed so we went to the fall-back logic.
The first read() got 624 bytes and the next read() got 0
(supposedly EOF). This confused us greatly, we kept allocating
buffers and reading and exercised the paging space.
Aaron Bannert [Tue, 29 Jan 2002 02:41:46 +0000 (02:41 +0000)]
Take advantage of the new pre_config return value when apr_proc_detach
fails. I'll be making some changes to apr_proc_detach, and it will be
nice to be able to report runtime errors.
Tested on worker but the code changes are identical on other MPMs.
Aaron Bannert [Tue, 29 Jan 2002 00:00:39 +0000 (00:00 +0000)]
I think this was supposed to have been bumped a couple times since
the 14th, and was perhaps forgotten about? In any case, it needs to
be bumped now -- pre_config hook return type has changed.
Jeff Trawick [Mon, 28 Jan 2002 18:30:07 +0000 (18:30 +0000)]
Fix some unix socket descriptor leaks in the handler side of
mod_cgid (the part that runs in the server process). Whack a
silly "close(-1)" in the handler too.
Bill Stoddard [Sun, 27 Jan 2002 12:52:08 +0000 (12:52 +0000)]
Remove the create_connection hook and put the client_socket back into the
conn_rec. The create_connection_hook has a design flaw that prevents it
from making decisions based on vhost information.
Shortcut where the resource has no language [discovered with no
DefaultLanguage in cgi-bin, resolving Greg Ames' observations, we
had a lurking segfault.]
This begs the question, what exactly did the fn do with no language
in terms of serving content back in 1.3. Should be reviewed.
Which PR? I can't count them all. Get QUERY_STRING and PATH_INFO
working again. Also rounds out our fix to work around negotiated
directories which Greg Ames fixed; this addition in request.c simply
shortcuts all further processing.
Brian Pane [Sun, 27 Jan 2002 07:30:02 +0000 (07:30 +0000)]
Fixed a read from a deleted brigade in the new version of
ap_rgetline()...
In the "folding" case, there was an ap_get_brigade() call after
the brigade had been destroyed. I noticed this while debugging
a memory leak that showed up while testing the httpd with ab.
Brian Pane [Sun, 27 Jan 2002 01:54:54 +0000 (01:54 +0000)]
Added new functions ap_add_input_filter_handle() and
ap_add_output_filter_handle()
There are many places in the core modules where we do
ap_add_input_filter() or ap_add_output_filter() on a
hardcoded filter name (e.g., "CORE" or "BYTERANGE").
This requires a string-to-filter mapping that wastes
CPU time. (Even though the string lookup uses a trie
for speed, it still ranks as a big consumer of CPU time
because of the large number of filters added per request.)
The new ap_add_*_filter_handle() functions will allow
us to skip the string-to-filter mapping in cases where
the module adding the filter happens to have the
ap_filter_rec_t* for the registered filter (e.g., because
it's the same module that registered the filter in the
first place).
Jeff Trawick [Sat, 26 Jan 2002 23:01:31 +0000 (23:01 +0000)]
ap_rgetline(): completely ignore an empty bucket... previously the logic
generally worked but with a memory debug build it could
crash since some memory debuggers don't like an alloc of
zero bytes
Greg Ames [Sat, 26 Jan 2002 20:16:01 +0000 (20:16 +0000)]
ap_sub_req_lookup_dirent: fix mod_negotiation loop with near infinite
subrequests
this function has been creating bogus subrequest URIs when there is
path_info for a long time. They didn't matter until fixup_dir started
using them for URI subrequests, which led to a loop with ever growing
bogus internal URIs and filenames.
Ian Holsman [Fri, 25 Jan 2002 20:09:33 +0000 (20:09 +0000)]
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.
No. I don't like this patch. I like what it does [shared scoreboard
for Windows, finally] but not how it's implemented.
However it works, and is equally crufty to what already exists for
win32 listeners and other exposed data within scoreboard.c.
To do this right, we need to drop all the external references to data
within the scoreboard, and add an accessor for remaining bits (such as
Win32's need for direct access to the apr_shm_t.) And within Win32,
we need to stack all this _within_ the pre-mpm hook. But those are
missions in and of themselves.
Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length. This is
much more consistent. Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length. This makes it now possible to
pass constants down without assigning them to a temporary variable first.
Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
some circumstances
Greg Stein [Fri, 25 Jan 2002 00:17:31 +0000 (00:17 +0000)]
Fix some serious, hard-core breakage :-( I don't even know how it
compiled and linked.
* there is no UNIX symbol, so go back to #ifndef WIN32. that other
platforms can pile on as needed until we have a proper mechanism.
* reinstate the liveprop callbacks and the dav_hooks_liveprop_fs
structure. since the latter structure is referred to elsewhere in
the file, it better be defined.
* use a "feature" name of DAV_FS_HAS_EXECUTABLE rather than
conditionally specifying the property. convert the tests over to
that symbol.
Rewrite ap_rgetline to remove the need to have an "internal" brigade stored
in the core_module structure by using the AP_MODE_SPECULATIVE filter mode
to determine if MIME-continuation should occur.
Notes:
- ap_rgetline has a new prototype.
- ap_rgetline returns APR_ENOSPC when we are out of buffer space.
All direct callers of ap_rgetline are now adjusted to handle this new API.
ap_getline will mimic the old API for now.
Divorce dav_fs from the DAV_PROPID_FS_executable property at the
very head of this module, and drop all references as soon as we
determine that 'our property' isn't supported.
Cause dav_fs_get_parent_resource to fail if the file path is entirely
invalid or incomplete, or if it is root [determined by the platform's
apr implemention]. Identified by Greg Stein.
Eliminate a large number of Win32-isms. In large part, these can apply
to other one-off platforms such as OS2, and immediately impact a new port
which played by all the APR rules.
Aaron Bannert [Wed, 23 Jan 2002 07:10:16 +0000 (07:10 +0000)]
Currently pcre/config.h and pcre/internal.h are getting installed - it
seems they aren't used, and adding a rogue config.h into the include
path can cause problems for a module which picks it up.
(Better late than never -- this patch was submitted Fri, 7 Dec 2001.)
Submitted by: Joe Orton <joe@manyfish.co.uk>
Reviewed by: Aaron Bannert
Aaron Bannert [Wed, 23 Jan 2002 06:51:18 +0000 (06:51 +0000)]
Although this patch is technically correct, I'm not happy with
the way it gets things done. OTOH, it is a simple enough change
to get things working correctly for now. I will come up with
the right way to do this in the next couple days.
This patch re-enables the use of anonymous shared memory in the
scoreboard on platforms that have it.
Ian Holsman [Mon, 21 Jan 2002 01:43:30 +0000 (01:43 +0000)]
These changes are to allow caching of subrequests via a quick_handler.
* Change SUBREQ_CORE so that it is a HTTP_HEADER (20) filter instead of a content filter (10)
this allows subrequests to add content filters properly
* Change subreq handling of 'handle-include' so that it splits/passes the brigade before the subreq
is created. (This allows quick_handler to push content back from this phase)
Joshua Slive [Sat, 19 Jan 2002 17:39:48 +0000 (17:39 +0000)]
This example doesn't really do what it claims. Instead, lets make it simpler
by discussing ONLY the .htaccess issue. The other issue is covered by the
next example.
Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.
We also no longer look at readbytes to determine the method of
filter operation. This makes the use of filters more obvious and
allows a wider range of options for input filters modes.
To start with, the new input filter modes are:
AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)
The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ
This also allows cleanup of mod_ssl's handling in the getline case.
Reviewed by: Ryan Bloom (concept), Greg Stein (concept)