Bill Stoddard [Mon, 22 Apr 2002 03:25:40 +0000 (03:25 +0000)]
Added the APLOG_TOCLIENT flag to ap_log_rerror() to
explicitly tell the server that warning messages should be sent
to the client in addition to being recorded in the error log.
Prior to this change, ap_log_rerror() always sent warning
messages to the client. In one case, a faulty CGI script caused
the server to send a warning message to the client that contained
the full path to the CGI script. This could be considered a
minor security exposure.
Brian Pane [Sat, 20 Apr 2002 20:41:33 +0000 (20:41 +0000)]
Workaround to get leader/follower compiling on recent Linuxes:
apr_atomic.h includes some <asm/*.h> header files that clash
with stdlib.h, so I've moved apr_atomic.h so that it's included
after all the other header files.
Propogate the change to insert "bucket_" into the names of the
static functions that operate on various bucket types to make
backtraces more sensible-looking.
showstoppers+=2; :-( ...but these might have already been fixed, I just
never got a response on-list about them and wanted
to note them somewhere where they wouldn't be
forgotten
Paul J. Reder [Fri, 19 Apr 2002 19:16:23 +0000 (19:16 +0000)]
Moved the call to apr_mmap_dup outside the error branch so
that it would actually get called. This fixes a core dump
at init everytime you use the MMapFile directive. [Paul J. Reder]
Jeff Trawick [Fri, 19 Apr 2002 18:31:20 +0000 (18:31 +0000)]
Trigger an error when a LoadModule directive attempts to
load a module which is built-in. This is a common error when
switching from a DSO build to a static build.
SOCKETs are HANDLEs, but they type mismatch. This fix has now been
verified by the vast majority of folks complaining about the "Not a
handle" failures in WSADuplicateHandle, later in the code flow.
Jeff Trawick [Fri, 19 Apr 2002 14:04:30 +0000 (14:04 +0000)]
Change instdso.sh to use libtool --install everywhere and then
clean up some stray files and symlinks that libtool leaves around
on some platforms. This gets subversion building properly since
it needed a re-link to be performed by libtool at install time,
and the old instdso.sh logic to simply cp the DSO didn't handle
that requirement.
Submitted by: Sander Striker
Reviewed by: Jeff Trawick
Brian Pane [Fri, 19 Apr 2002 08:02:00 +0000 (08:02 +0000)]
Some code transformations to improve the generated assembly
code within the critical region inside the spin locks. (Shortening
this code path reduces the probability that we'll have to spin.)
Switch ap_http_filter to use ap_get_brigade and apr_brigade_flatten
instead of ap_getline - this prevents some odd looping issues that
can cause problems.
Also, when we call get_mime_headers to read the trailers, we need
to reset our ctx->state to BODY_NONE - there should only be MIME-header
information (followed by a blank CRLF line) - and we don't know
how much data there will be - so it is by definition BODY_NONE.
Simplify last commit by only calling cat once (this should hopefully resolve
rbb's concern about maintainability and still address mine about annoying /s).
Don't call mkdir when we are the top-level directory. We *have* to have
been created before hand.
Replace this bogus check with something that actually works. I have no
idea what this line is attempting to do, but it doesn't work in the
top-level Makefile - causing an error. Therefore, take the line we use
in APR to check if a file exists.
The pedant in me wishes to see all extraneous trailing / go away.
So, if we are in the top-level makefile, don't add an extra trailing
slash to srcdir, builddir, or VPATH. It's annoying.
Bill Stoddard [Wed, 17 Apr 2002 18:52:32 +0000 (18:52 +0000)]
Fix seg fault when garbage collecting an expired entry. remove_entity
should just remove the object from the cache and set the cleanup flag
in the object. decrement_refcount will clean the object up when the refcount
goes to zero.
Experimental patch that may mitigate (but not eliminate) the errors in
[crit] (32538)An operation was attempted on something that is not a socket.
: Parent: WSADuplicateSocket failed for socket ...
if the particular stacks' bug is that it won't associate a handle as a
socket if that handle was duped with DuplicateHandle(). Other bugs with
unimplemented WSADuplicateSocket are not addressed by this patch.
Introduced -E startup_logfile_name option to httpd to allow admins
to begin logging errors immediately. This provides Win32 users
an alternative to sending startup errors to the event viewer, and
allows other daemon tool authors an alternative to logging to stderr.
Jeff Trawick [Wed, 17 Apr 2002 15:45:27 +0000 (15:45 +0000)]
use an independent pool for threads so that when we abandon them
during graceless termination the cleanups on pchild won't mess with
stuff they are still referencing
Brian Havard [Wed, 17 Apr 2002 14:55:20 +0000 (14:55 +0000)]
When an exception in a worker thread initiates a child shutdown, get things
moving sooner by sending a SIGHUP to the accept thread, breaking it out
of its accept/poll.
Fix subreqs with non-defined Content-Types being served improperly.
If we do not know a C-T for a subreq, we *must* propogate that
non-knowledge upwards to the main request.
Previously, if you used a DirectoryIndex with a file without a C-T (say
.shtml without AddType), the r->content_type will be kept as
httpd/unix-directory when we promoted the subreq in mod_dir. Since there
would be no handler on this file, ap_invoke_handler (config.c:355) would
set the handler to be httpd/unix-directory (which was the old C-T of the
dir). This would then trigger the handler to become httpd/unix-directory.
mod_autoindex would then try to serve the request. But, the filename
was propogated upwards by mod_dir's DirectoryIndex via
internal_fast_redirect - it would then return a 403 trying to generate a
mod_autoindex page for a file.
Now, we will use ap_default_type() which is correct.
Tired of 'foo.h not found' messages in the build. Checked ms's docs,
seems xcopy's /y arg goes all the way back to Win95. This shouldn't
introduce any hassles.
Brian Pane [Tue, 16 Apr 2002 23:37:06 +0000 (23:37 +0000)]
Another experimental MPM derived from worker:
The threadpool MPM implements Aaron Bannert's "time-space tradeoff"
design managing idle workers. Rather than putting accepted connections
into a queue, the threadpool MPM keeps idle worker threads in a stack.
Its dedicated listener thread retrieves an idle worker from the stack
before accepting a connection. If there are no idle workers, the
listener blocks until a worker becomes available before doing an accept.
In many ways, threadpool is also a variant of leader/follower. They
both maintain a stack of idle threads. The difference is that threadpool
has a dedicated listener thread, and leader/follower rotates the listening
responsibility among its worker threads. In my initial testing, the
leader/follower MPM performs very well on multiprocessor Solaris 8 when
listening on a single port, but poorly when listening on multiple ports.
(I don't know why this is happening. What I've found so far is that
when you add a poll on the listen socket(s) before the accept in the
leader/follower MPM, all the socket-related syscalls in the httpd get
slower. My hypothesis is that the thread scheduler is making an optimal
decision about where (on what CPU) to run the newly awakened thread if
its first syscall is an accept, and a nonoptimal decision if its first
syscall is a poll.) The threadpool MPM performs better with multiple
listener ports, and in my testing so far it looks competitive with
leader/follower when running with a single listener.
Merge in latest GNU config.guess and config.sub files. Synchronize all
config.guess/config.sub files to be identical. Previously, we had three
different versions of the guess files - now they are the same.
I attempted to merge in ASF changes that were marked and still needed.
Please verify that these work on your platform. (Particular attention
is required for the IBM platforms.)
Part of PR 7818 stems from the fact that the bundled expat did not have an
included config.guess/config.sub. Therefore, it would take the config.guess
from the system. Icarus's autoconf/libtool is very old (2.13/1.3.5). The
machine that was used to roll 2.0.32 had a recent autoconf/libtool which
explains the behavior that Sander saw in the PR. Therefore, we now
explicitly provide a config.guess/.sub for the bundled expat so that
all of the versions are in sync. This should minimize configuration
problems.
pcre was using a config.guess that was imported when Brian made the 3.9
import. It did not have the Apache modifications, but seems to have
had the Darwin changes. Go figure. Sync it up as well.
PR: 7818
Obtained from: GNU FSF - ftp.gnu.org/gnu/config
worker is not the default Unix MPM. [This statement has been in the docs
ever since this was copy-and-pasted from the threaded MPM documentation,
and threaded *was* the default at one point.]
Move 100 - Continue support to the HTTP_IN filter so that filters
are guaranteed to support 100 - Continue logic without any
intervention.
This requires some reshuffling of the code in http_protocol.c so
that some static declarations are available early enough in the
code so that ap_http_filter can access them.
Note that we can not read the chunk until after (possibly) sending the
100.
Adds support for reading trailers on input by exporting get_mime_headers
to ap_get_mime_headers and calling it in the appropriate place in
ap_http_filter.
ap_send_error_response: reset r->output filters to the protocol filters.
The equivalent logic was deleted when request filters were renamed to
RESOURCE filters. This fixes the seg faults that sometimes happen on
daedalus after a bogus 416 HTTP response is generated.
In this case, includes_filter had found an <!--#include virtual > tag, and
sent a brigade representing the data before it down the filter chain. The
byterange filter generated the bogus 416. ap_send_error_response essentially
starts over with a new response, but it didn't do anything to clean up the
filter chain. So the same instance of the includes_filter got driven from the
top with the canned error text and and EOS bucket, which confused the heck
out of it. It inserted a sentinel from the original brigade into the
error page brigade, causing problems further down the filter chain.
would get a 400. RFC 2616 specifically allows for a "blank" host field.
The read_request code properly handled this, but the fix_hostname in
vhost.c would cause the 400. Now, simply return in fix_hostname when
we see a blank hostname rather than erroring out.
Brian Havard [Sun, 14 Apr 2002 08:38:15 +0000 (08:38 +0000)]
Get local address info in listener sockets initialized when constructed in
the child process from a descriptor passed from the parent. This fixed vhost
address matching.
If we have a registry command or a shebang line invocation, correct the
invocation type to APR_PROGRAM_PATH so we will both search the path, and
accept undecorated names, e.g. "perl" should be acceptable for "perl.exe".
In order for Win32 to accept the shebang line of #!perl so we 1) search
the PATH and 2) resolve perl.exe for perl, we must add the progtype so
we can override APR_PROGRAM with APR_PROGRAM_PATH. This is the API change
only for the cgi build command line option function.
Correct const'ness of argv in all support apps, and use the new
apr_app_initialize over apr_initialize for win32, and other platforms
that may wish to tweak 'apr-ized' application support (e.g. Netware?)
Readjustment of where the bucket is being allocated now that they are being
cleaned up. Need to move the call to after apr_pool_clear() so that it doesn't
get cleanup too soon and never reallocated.
Jeff Trawick [Fri, 12 Apr 2002 19:58:52 +0000 (19:58 +0000)]
worker MPM: Fix a situation where a child exited without releasing
the accept mutex. Depending on the OS and mutex mechanism this
could result in a hang.
Touch these files so that their datestamps are newer than the corresponding
.y and .l files. These must be kept newer than those at all times to avoid
introducing a dependency on flex and yacc.
Flip the order. If the user specifies ScriptInterpreterSource,
either Registry or RegistryStrict, test the registry in preference
over a shebang line. This is how 1.3 behaved, and allows scripts
with invalid shebang lines (straight from another box, for example)
to run without modification.