Bill Stoddard [Fri, 13 Jul 2001 18:46:15 +0000 (18:46 +0000)]
Win32: Prevent listening sockets from being inherited by
the Apache child process, CGI scripts, rotatelog process
etc. If the Apache child process segfaults, any processes
that the child started are not reaped. Prior to this fix,
these processes inherited the listening sockets which sometimes
prevented the restarted Apache child process from accepting
connections (ie, the server would hang).
The Sleep(1000) is a bit of a hack but it is sufficient I believe. All
that is really necessary is for the parent to give up its quantum and
allow the child to run. I could not get WaitForInputIdle to work properly.
Will investigate alternative solutions later.
Jeff Trawick [Wed, 11 Jul 2001 14:48:23 +0000 (14:48 +0000)]
Fix an issue with the pod and prefork:
when the parent process wakes up a server process via connect(), use
an APR timeout on the connect() so that we don't hang for a long time
if there aren't server processes around to do accept()
Bill Stoddard [Wed, 11 Jul 2001 04:47:02 +0000 (04:47 +0000)]
Performance improvement to mod_mime.c. find_ct() in mod_mime,
spends a lot of time in apr_table_get calls. Using the default
httpd.conf, the tables for languages and charsets are somewhat
large, so the time spent scanning them on each request is
significant. Replacing the tables with hash tables provides
a nice speedup. [Brian Pane <bpane@pacbell.net>]
Had to handmerge a lot of this patch so please review! Dean had some suggestions
for improvement which are not currently implemented.
Submitted by: Brian Pane
Reviewed by: Bill Stoddard
fix pid numbers in mod_status output when using a threaded mpm. pid_buffer was
being indexed by worker slot during initialization, then by process slot when
generating output.
This saves a little storage and a few cycles, too.
Ryan Bloom [Tue, 10 Jul 2001 19:00:03 +0000 (19:00 +0000)]
Add two functions to allow modules to access random parts of the
scoreboard. This allows modules compiled for one MPM to access the
scoreboard, even if it the server was compiled for another MPM.
Jeff Trawick [Tue, 10 Jul 2001 18:56:55 +0000 (18:56 +0000)]
Check the pod after processing a connection so that we'll go away
if a graceful restart occurred while we were processing the
connection. Otherwise, we won't wake up until a real connection
comes in and we'll use the wrong config to process it and we may
block in the wrong syscall (because the new generation is using a
different accept mutex) and in general it is goofy.
Ryan Bloom [Mon, 9 Jul 2001 02:31:09 +0000 (02:31 +0000)]
Allow all parts of Apache 2.0 to build when --srcdir is used. This
required exposing a build directory and a source directory to all parts
of Apache's build system. It also required a small hack in APR-util, if
we are using the bundled Expat, and we are using VPATH support, then we
have hard-coded the xml/expat location. I couldn't figure out how to
allow the configure script to determine the correct location. I added a
comment, but if somebody else figures it out, we should fix that at some
point.
Avoid redundant strlen() calls by using apr_brigade_write() instead of
apr_brigade_puts(). There is still some redundancy--it'd be ideal if there
were an apr_pstrcat() variant that returned the length of the string since
it computes it (twice) anyway so we didn't have to do it yet again. Until
such a beast exists, computing the length three times is better than four.
:-/
Ryan Bloom [Sun, 8 Jul 2001 03:27:18 +0000 (03:27 +0000)]
We need to pass the prefix to APR, APR-util, and PCRE. If we don't
pass that information, then all three libraries will install themselves
into their default locations.
PR: 7750
Bill Stoddard [Fri, 6 Jul 2001 18:41:56 +0000 (18:41 +0000)]
Add error message and return if we fail reading from a bucket in the
core_outout_filter(). core_output_filter() is in need of a rewrite, it is
getting quite crufty.
Bill Stoddard [Fri, 6 Jul 2001 00:28:41 +0000 (00:28 +0000)]
Reimplement content length filter to fix problem where all output from
CGI scripts was being buffered in the brigade before any of it was
written to the network. cl filter now honors flush and implements a
buffer threshold.
Ryan Bloom [Thu, 5 Jul 2001 04:27:56 +0000 (04:27 +0000)]
Add documentation for mod_suexec. And add a note in the old docs
about User that SuexecUserGroup now replaces putting User/Group directives
inside of VirtualHosts.
PR: 7634
Ryan Bloom [Thu, 5 Jul 2001 01:23:00 +0000 (01:23 +0000)]
The ExtendedStatus directive was added back to mod_status when we
re-vamped that module before the first beta. Since we put the directive
back, we should put it into the default config file.
PR: 7937
David Reid [Wed, 4 Jul 2001 03:16:33 +0000 (03:16 +0000)]
Having gone through and expnaded out the hook macro it seemed a waste
to throw it away, so here it is added as comments for people who are
in the same place I was trying to debug what was going on inside a hook.
Ryan Bloom [Tue, 3 Jul 2001 13:58:10 +0000 (13:58 +0000)]
Fix the forking/killing logic in the threaded MPM. The problem we were
seeing with the server eating itself wasn't because we were comparing
the idle_thread_count and min/max spare servers wrong. It was because
we were counting idle_thread_count incorrectly. This fixes that problem.
Ryan Bloom [Tue, 3 Jul 2001 05:16:33 +0000 (05:16 +0000)]
This fixes the problem of the server not starting new processes to keep
up with a heavy load. The server still doesn't kill processes correctly,
so we need to fix that, but we are closer now.
Ryan Bloom [Sun, 1 Jul 2001 22:49:31 +0000 (22:49 +0000)]
Fix the threaded MPM perform_idle_server_maintenance. Basically, we now
count how many threads are actually idle, regardless of which process they
are in. This patch makes us use (min_spare_threads|max_spare_threads)
* number_of_running_servers to determine if we should kill of processes or
start new ones. This MPM no longer thrashes killing child processes as
soon as they are created, and the server continues to serve requests even
if the server is gracefully restarted and each child has one active thread.
Last check-in went awry.
Here is the intended message.
Put the QUIT command back.
Basically, when a LIST occurs, origin is not available for reading until the data connection
is closed in passive mode.
This takes care of that.
Deploy ap_sub_req_lookup_dirent() for the main loop. Note we _really_
need to further optimize this code, there are dozens of perhaps unnecessary
stat calls, and meaningless #ifndef OS2 protections around apr_lstat()'s.
OS2 has lstat (It's simply stat()) so we should pull the os-specific cruft.
Sorry, second pass, working on legibility. This patch introduces the
fill_in_sub_req_vars function to propogate the rnew values, but doesn't
yet hook it in. Note that there are two discrepancies, apparently
pretty bad ones, that have been moved after the 'common code' so the
next patch becomes pretty simple.
Cliff Woolley [Wed, 27 Jun 2001 20:18:09 +0000 (20:18 +0000)]
*) Account for the new pool parameter to apr_bucket_file_create()
and apr_bucket_file_make().
*) Simplify mod_file_cache's sendfile_handler by taking advantage
the new ability of file buckets to handle files opened in XTHREAD
mode. [Also inlined some of the brigade construction stuff in
mod_file_cache's handlers to save a palloc() or two.]
Move duplicated rnew cloning from apr_ap_sub_req_lookup_*() functions,
and add an ap_sub_req_lookup_dirent() to create a subrequest from the
results of an apr_dir_read() for mod_negotiation and mod_autoindex.