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

2055 Commits

Author SHA1 Message Date
Brian Pane
94de8923db Fix for a bug that I introduced when eliminating the single-byte
reads in mod_cgi: eof wasn't treated as an error condition when
reading the script headers, so we were delivering a 200 when a
CGI script produced no output.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94342 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 22:48:39 +00:00
Paul J. Reder
78ae2a9eb4 PR:
Obtained from:
Submitted by:	Paul J. Reder
Reviewed by:

Remove the MPM_SYNC_CHILD_TABLE macro since there is no longer a scoreboard
file that needs to be synched.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94308 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 16:15:33 +00:00
Jim Jagielski
70bb2575ea The old, legacy (and unused) code in which the scoreboard was totally
and completely contained in a file (SCOREBOARD_FILE) has been
removed. This does not affect scoreboards which are *mapped* to
files using named-shared-memory at all. This implies that scoreboards
must be based, at some level, on native shared memory (mmap, shm_open,
shmget, whatever), but the code has assumed that for quite awhile
now. Having the scoreboard be *based* on a file makes no sense today.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94306 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 14:33:50 +00:00
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
7da34b011d Add a new parameter to the quick_handler hook to instruct
quick handlers to optionally do a lookup rather than actually
serve content. This is the first of several changes required fix
several problems with how quick handlers work with subrequests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94240 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 22:42:16 +00:00
Jeff Trawick
97659630cc worker MPM:
get MaxRequestsPerChild to work again by allowing the main thread of
a child to be interrupted by one of the other threads in the process

this should get graceful termination to work after encountering one of
the various possible error conditions in the listener and worker threads


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94232 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 20:37:32 +00:00
William A. Rowe Jr
4dd3d43b9c Somewhere about server/main.c rev 1.54, we lost the stop|shutdown|uninstall
when the .conf file is missing or horribly corrupt.  Move those actions
  into the rewrite args phase so we don't trip over a missing .conf file,
  we couldn't care less if we are stopping/uninstalling Apache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94189 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 20:13:37 +00:00
William A. Rowe Jr
71a2c46459 -i and -u were deprecated some time ago, they still work in 1.3, but
shouldn't be expected to work in 2.0.  Replacement command line options
  are -k install|uninstall


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94161 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 19:05:59 +00:00
William A. Rowe Jr
1a167d571f Integrate rbb's forward port of -k config into the -h(elp), and
reorder some directives in the -h(elp) so they 'flow'.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94160 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 19:04:28 +00:00
Brian Pane
804f94d21f Changed mod_cgi to not do single-byte reads to consume the
script headers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94151 13f79535-47bb-0310-9956-ffa450edef68
2002-03-23 23:19:41 +00:00
Ryan Bloom
f44773343a We have to return valid HTTP status codes from filters. This fixes two
cases in the core_output_filters where there was a problem, and the core
returned an error code instead of an HTTP status code.  This keeps us from
putting status codes like 32 and 104 in the access log.

Submitted by:	Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94143 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 21:45:44 +00:00
Bill Stoddard
89b670a875 Tag some pools
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94140 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 20:24:22 +00:00
Bill Stoddard
d317a65c5b Tag some pools.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94139 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 20:23:00 +00:00
William A. Rowe Jr
9f94a00016 Err, that was a bit redundant. Eliminate the redundant test [and clean
up some tabs I inadvertantly introduced.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94118 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 05:52:16 +00:00
Jeff Trawick
db1f8661e6 document yet another worker MPM glitch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94117 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 03:43:22 +00:00
Ryan Bloom
ba4014adba Port the -k config option to Apache 2.0. This allows users to reconfigure
their service after it has been installed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94113 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 01:28:01 +00:00
Jeff Trawick
61c0797041 remove some unnecessary, commented-out code; add a comment
about a use of signals


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94112 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 01:12:49 +00:00
Jeff Trawick
4867fb1974 Don't drop connections during graceful restart. Previously, worker
threads could exit even though there were connections waiting in the
queue.

Now, for a graceful restart the worker threads won't exit until they
are told that the queue has been drained and no more connections will
ever be added.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94106 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 19:12:54 +00:00
Jeff Trawick
d1122ee9cc graceful shutdown (no dropped connections) requires that the listener
go away before the workers...  introduce separate XXX_may_exit flags
for our different categories of threads so that a future fix for
graceful shutdown can terminate them in the right order

rename signal_workers() to signal_threads() and give it a parameter
so it knows whether or not termination should be graceful

this commit doesn't change the behavior in any noticeable way;  the
flags used to tell threads to go away are still set at about the same
time


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94095 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:31:39 +00:00
Jeff Trawick
533551f8a7 document a glitch that prevents complete graceful termination of the
process when one of the threads encounters a critical error


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94094 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:18:11 +00:00
Jeff Trawick
3289de6264 make the comment for the call to apr_signal_thread() a little more
correct about what it is going to do


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94091 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:06:51 +00:00
Jeff Trawick
ca62366801 fix a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94088 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 15:27:31 +00:00
Jeff Trawick
1e799a88e6 axe some unused fields in ap_queue_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94087 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 15:19:54 +00:00
Sander Striker
b2bb3f6764 Update callers of apr_explode_gmt to apr_time_exp_gmt. The
function was renamed in apr.

Submitted by: Thom May <thom@planetarytramp.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94081 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 10:10:41 +00:00
William A. Rowe Jr
029da7dc7b Correct our list of escape characters to include percent and the
carriage return on Win32/OS2, and modify the \r \n escaping to account
  for the fact that Win32/OS2 don't pass these characters through a true
  argv[] mechansim; replace them with a whitespace since they effectively
  are for most applications.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94070 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 05:28:14 +00:00
Jeff Trawick
5ffc63f688 don't log a failure of ap_queue_pop() at termination; it is
expected


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94068 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 03:40:23 +00:00
Jeff Trawick
c366452ca7 in a worker thread, don't dare try to process a connection if
ap_queue_pop() failed...  csd is not cleared by ap_queue_pop()
so checking csd is not helpful


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94067 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 23:29:13 +00:00
Jim Jagielski
730e99e461 Fold the compiled-in knowledge of the allowable AcceptMutex settings into
its help entry. Requires the use of a extern string rather than a function
call for the initialization to be valid in the macro (Thx to Jeff!).
In the meantime, bump down the error logging until we deal with true
default and configured setting information ala 1.3.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94062 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 22:19:11 +00:00
Jeff Trawick
eada6f8255 no need to kill the scoreboard cleanup anymore on graceful
restart; the scoreboard is longer-lived
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94061 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 20:38:52 +00:00
Jeff Trawick
d94b9f34d6 ap_create_scoreboard() now initializes the scoreboard if it already exists,
so MPMs shouldn't call it for a graceful restart


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94060 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 20:30:46 +00:00
Jeff Trawick
e8dc265c9a write a debug message to the log when we're stuck in the sicko state
of trying to take over scoreboard slots that aren't going to be released
(we could also be stalled while taking over slots if a thread in child
gracefully terminating is serving a long-running request)

update a comment describing the sicko state to remove any information
I'm not absolutely sure of


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94059 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 19:53:18 +00:00
Bill Stoddard
76bef9981f Commit 2 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94057 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:44:13 +00:00
Jim Jagielski
a65170a84c Bring 2.0 up to parity, a bit, with how much info we provide to
the admin regarding valid values for AcceptMutex. Should also
tell 'em what "default" actually maps to, but that can wait.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94055 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 16:44:13 +00:00
William A. Rowe Jr
cb7bb7bb8c No sense in opening this event when it's already opened in the parent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94050 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 07:49:02 +00:00
William A. Rowe Jr
b20779da03 Here's the patch that really sucks. old_listeners points to an array
of apr_socket objects already destroyed by their cleanups, and in any
  case they now live in invalid memory.  Extend their lifetimes.

  This implies that the process pool grows on every restart for no good
  reason.  One possible solution is to let the old pconf survive until
  the new pconf is alive.  Another is to create the listeners in a subpool
  of process->pool, destroyed after the old_listeners are closed.

  Either which way, a better solution exists, but this closes the immediate
  bug.  [How haven't we been segfaulting in unix on restarts before this
  patch, gurus?]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94048 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 07:03:07 +00:00
William A. Rowe Jr
0a28d5809d More process lifetime changes, and simplify some ambigious cruft.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94046 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:55:39 +00:00
William A. Rowe Jr
cda6c47f99 Fix a few listener-related lifetime issues [they are created in the
open logs phase, only once.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94041 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:14:19 +00:00
William A. Rowe Jr
6e8a873d8c The source of some ills ... there is no reason to keep going if the
scoreboard exists.  I suspect this should be a general cleanup as well
  [at the end of ap_create_scoreboard.]  But calling ap_run_pre_mpm with
  the process->pool should take care of a clobbered scoreboard shm on
  graceful restart.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94040 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:04:51 +00:00
William A. Rowe Jr
cec6d4b870 The pre_mpm hook creates server-lifetime objects (or at least, for the
generations across graceful restarts.)  They should use the process pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94039 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 05:58:21 +00:00
William A. Rowe Jr
1ab2f45a70 When restarting [always graceful on Win32], we don't repeat pre_mpm
(Unix doesn't, we shouldn't either.)  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94032 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 04:29:55 +00:00
Jeff Trawick
ae65c40d8e Make the listener thread stop accepting new connections and exit
cleanly at graceful restart time.  This is a basic requirement of
reliable graceful restarts (the kind that won't drop connections).
This allows a future fix to make worker threads hang around until
they service all connections previously accepted by the listener
thread.

The old mechanism of doing a dummy connection to wake up the
listener thread in each old child process didn't work.  It didn't
guarantee that (in the main thread) the byte was read from the pod
and global variables were set before the listener thread grabbed
the connection.  It didn't guarantee that a child process in the
new generation didn't get some of the dummy connections.

Rather than burn extra syscalls adding a unique socket or pipe
to the poll set (and breaking single listen unserialized accept
in the same change), this uses a signal sent from the main thread
to the listener thread to break it out of the poll or accept.
(We don't worry about breaking it out of the optional mutex because
the child process holding the mutex will break out of poll/accept
and release the mutex, allowing a child blocked in the mutex to
get it.  Eventually all children blocked in the mutex will come
out.)

Since the listener thread now exits reliably, the main thread
joins it.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94031 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 03:54:25 +00:00
Jeff Trawick
f8827903aa get the start thread to exit when we have reached termination but
it is still trying to create worker threads

previously, after a non-graceful restart followed by a terminate
you could see a bunch of log messages showing the parent repeatedly
sending SIGTERM and finally SIGKILL to one or more children...
with this change, the sequence of messages should stop very soon

add a comment to start_threads() describing a current problem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94030 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 03:38:07 +00:00
Bill Stoddard
e9ec908a01 Final commit to add ap_rset_content_type accessor. Add AddOutputFiltersbyType
filters during call to ap_rset_content_type()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94028 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 02:05:43 +00:00
Jeff Trawick
32fe8d097f be a little more specific in a thread-create error message
it is helpful to distinguish between a failure creating the
first thread (listener) vs. a failure creating one of n
worker threads


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94025 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 22:09:26 +00:00
Jeff Trawick
cfcab38a77 "apachectl stop" shouldn't send the gracefully-terminate char down
the pod...  the child processes need to know that it isn't a graceful
termination and they shouldn't wait for old connections to finish


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94024 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 21:31:04 +00:00
Ian Holsman
9e7b6b7aee forgot the actual change
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94020 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 19:01:50 +00:00
Jeff Trawick
80788ba82a get rid of unnecessary code to track the number of worker threads
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94017 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 17:56:57 +00:00
Jeff Trawick
928aff8a02 Fix a hang condition with graceful restart and prefork MPM
in the situation where MaxClients is very high but
much fewer servers are actually started at the time of the
restart.

The way we notify an entire generation to die at once is
changed so that we don't have to use the pod (and deal with
the ease of filling the kernel pipe buffer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93999 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 18:24:55 +00:00
Jeff Trawick
67f3ac2762 prefork and worker:
after allocating a new scoreboard, make sure the right generation
is stored in the global score


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93998 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 18:12:43 +00:00
Jeff Trawick
fab7f0a891 don't check for EINTR after a call to apr_file_write();
you'll never see it


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93997 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 16:39:56 +00:00