1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

210 Commits

Author SHA1 Message Date
Jeff Trawick
e0eb7d1eef Introduce a new set of APIs to allow MPMs to be proper modules instead
of integral parts which share global variables, functions, and macros
with the rest of httpd.

Converted now:
  prefork, worker, event, simple, WinNT*

*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:43:59 +00:00
Joe Orton
d5ea11eded * server/mpm_common.c (dummy_connection): If possible, use a non-SSL
listening port to use for the dummy connection, to avoid causing
  (confusing) error log spam by sending EOF down an SSL port.

PR: 39653


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726065 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 16:08:16 +00:00
Paul Querna
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
Nick Kew
72119d92f5 Switch all unix MPMs to use drop_privileges hook (mod_unixd) for startup
and add a flag to prevent running without any module taking responsibility
for managing system privileges!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709993 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 00:46:54 +00:00
Paul Querna
1457f7207a Add dummy ap_mpm_register_timed_callback for other MPMs besides Event.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697425 13f79535-47bb-0310-9956-ffa450edef68
2008-09-20 22:04:03 +00:00
Martin Kraemer
a210a65426 Avoid core dumps by getting the signal_description only if
a process actually terminated on a signal. Update status
only on a valid wait response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@617373 13f79535-47bb-0310-9956-ffa450edef68
2008-02-01 08:50:09 +00:00
Joe Orton
f73076edd1 * server/mpm_common.c (reclaim_one_pid): Retrieve the exit status from
apr_proc_wait(); call ap_process_child_status() for children which
  terminate, to ensure that abnormal exits (e.g. SIGSEGV) are logged.

PR: 42757


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@613263 13f79535-47bb-0310-9956-ffa450edef68
2008-01-18 20:49:46 +00:00
William A. Rowe Jr
1e84b4e15a Unless I've misread this, POD is write-blocking, read nonblocking timeout 0.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@587673 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 22:05:14 +00:00
William A. Rowe Jr
8d7fe950f2 ap_available_mutexes_string and ap_add_available_mutexes_string
cannot be data symbols when mod_ssl is built as a loadable module;
using an external string constant in a loadable module is not portable.

Also reorganize file and sem to follow their explicit mechanisms,
and ensured that the explicit mechansims are listed in order of 
preference.  

This raises a question, would [fcntl|file] be a clearer way of 
indiciating what the file/sem methods devolve to?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568833 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 05:55:11 +00:00
Jim Jagielski
269a403081 getpgid() returns a pid_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551889 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 13:28:58 +00:00
Joe Orton
0a0d324e07 Add alternative fixes for CVE-2007-3304:
* configure.in: Check for getpgid.

* include/mpm_common.h (ap_mpm_safe_kill): New prototype.

* server/mpm_common.c (reclaim_one_pid): Ensure pid validity before
calling apr_proc_wait().
(ap_mpm_safe_kill): New function.

* server/mpm/prefork/prefork.c, server/mpm/worker/worker.c,
server/mpm/experimental/event/event.c: Use ap_mpm_safe_kill() on pids
from the scoreboard, throughout.

* include/ap_mmn.h: Minor bump.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551843 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 10:33:14 +00:00
Joe Orton
ada9c28dcf Revert r547987 ("svn merge -c -547987 .")
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551835 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 09:31:11 +00:00
Joe Orton
f4fee126cc * server/mpm/prefork/prefork.c (reap_children),
* server/mpm_common.c (ap_wait_or_timeout): Remove dead code; NEED_WAITPID
has never been defined by the 2.x build system.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551823 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 08:43:29 +00:00
Jim Jagielski
86f602beb2 PID table impl: parent process keeps a local table store of
Apache child process PIDs and uses that to check validity
of what's in the scoreboard.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@547987 13f79535-47bb-0310-9956-ffa450edef68
2007-06-16 21:29:24 +00:00
Joe Orton
2af272c512 * server/mpm_common.c (dummy_connection): Use "OPTIONS *" for request
on dummy connection.

PR: 41796


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@517233 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 14:49:07 +00:00
Ruediger Pluem
6460ed2a77 * Nitpicking: Get the comment right.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@500897 13f79535-47bb-0310-9956-ffa450edef68
2007-01-28 21:51:43 +00:00
Jeff Trawick
97b575accb Unix MPMs: Catch SIGFPE so that exception hooks and CoreDumpDirectory
can work after that terminating signal.

Submitted by: Eric Covener <covener gmail.com>
Reviewed by:  trawick



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@500881 13f79535-47bb-0310-9956-ffa450edef68
2007-01-28 21:14:40 +00:00
Jim Jagielski
707d1dabb9 Once SSLMutex allowed for the setting of both the
locking method and the lockfile location, I never
liked how AcceptMutex was linked to LockFile. This
seemed unnecessary. Much better to have AcceptMutex
do both as well. Plus, now that we will likely see
other modules require a "standard" way of setting
mutexes, why not have Apache provide that as
an API of sorts.

Anyway, LockFile is now depreciated and AcceptMutex
is now SSLMutex-like. We also provide a short
function that "parses" out a mutex parameter
and strips out the mechanism and lockfile location.
AcceptMutex and SSLMutex is this capability.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@467326 13f79535-47bb-0310-9956-ffa450edef68
2006-10-24 13:17:29 +00:00
Jeff Trawick
743a621e8d Replace ap_get_server_version with ap_get_server_banner() and
ap_get_server_description().

High-level summary:

The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive.

Third-party modules must now use ap_get_server_banner() or 
ap_get_server_description() in place of ap_get_server_version().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 13:08:15 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Colm MacCarthaigh
a500939eb8 Add ap_relieve_child_processess(), a non-infanticidal copy of
ap_reclaim_child_processes(). Allows us to waitpid() each process in the
scoreboard and each "extra" process with a single call.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240465 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 22:12:08 +00:00
Colm MacCarthaigh
d7c04b158c Move the "GracefulShutdownTimeout" directive into mpm_common, for re-use
with other MPM's.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240296 13f79535-47bb-0310-9956-ffa450edef68
2005-08-26 17:43:24 +00:00
Colm MacCarthaigh
432af0071e Make the neccessary changes to mpm_common and main to support a graceful-stop
command line argument. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240269 13f79535-47bb-0310-9956-ffa450edef68
2005-08-26 16:00:59 +00:00
Colm MacCarthaigh
395896ae8d Remove support for the threaded-mpm's on Linux 2.0, and de-autoconf the
graceful restart signal. Frees up SIGWINCH for implementing graceful stop.
See <20050727114058.GA3390@stdlib.net> and subsequent thread on httpd-dev.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239430 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 16:41:17 +00:00
Paul Querna
cc2db72ca1 Add a User-Agent to the dummy connection code to ease admin debugging.
Submitted By: Colm MacCarthaigh <colm stdlib.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230808 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 14:37:14 +00:00
Joe Orton
11865f1c06 * server/mpm_common.c (dummy_connection): Fix length argument passed
to apr_socket_send.  Remove redundant _shutdown call.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@202508 13f79535-47bb-0310-9956-ffa450edef68
2005-06-30 09:10:25 +00:00
Paul Querna
288bb4c9f7 Argh. Style Fix. Habits are hard to kill.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@202039 13f79535-47bb-0310-9956-ffa450edef68
2005-06-27 19:30:23 +00:00
Paul Querna
d72e95a02c *) server/mpm_common.c: Send a simple HTTP 1.0 request to every listener socket, instead of just closing the socket. This fixes shutdown of the Worker MPM on FreeBSD, when Accept Filters are enabled.
In the future, we need a method to send a simple request for all protocols.  Currently this is very specific to HTTP and FreeBSD's Accept Filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@202027 13f79535-47bb-0310-9956-ffa450edef68
2005-06-27 18:40:56 +00:00
Nick Kew
fef85f7869 Fix for reported compile problem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@189475 13f79535-47bb-0310-9956-ffa450edef68
2005-06-07 23:45:50 +00:00
Nick Kew
b0a5cb0bb9 Add monitor hook (discussed under "watchdog" thread).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@188846 13f79535-47bb-0310-9956-ffa450edef68
2005-06-07 19:13:37 +00:00
Jeff Trawick
68c0bb9ea3 restore google-ability of an ancient message of great importance
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@154044 13f79535-47bb-0310-9956-ffa450edef68
2005-02-16 16:44:26 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Jeff Trawick
592750b026 worker MPM: Fix a problem which could cause httpd processes to
remain active after shutdown.

The problem occurred when a scoreboard entry currently
in use by an exiting child process was used for a new child
process.  At that point, the MPM forgot about the exiting
child process, so ap_reclaim_child_processes() wouldn't be
able to forceably terminate it.

(An exiting child process may *never* exit due to a stuck
or long-running request being handled on one of the threads.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109510 13f79535-47bb-0310-9956-ffa450edef68
2004-12-02 17:39:22 +00:00
Jeff Trawick
1362105279 zap extra blank in error message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106918 13f79535-47bb-0310-9956-ffa450edef68
2004-11-29 15:37:03 +00:00
Joe Orton
5eba2483b2 * server/mpm_common.c (dummy_connection): Log the address if the
connect() fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105264 13f79535-47bb-0310-9956-ffa450edef68
2004-09-23 08:59:06 +00:00
Jeff Trawick
130c053d26 Unix MPMs: Shut down the server more quickly when child processes are
slow to exit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105195 13f79535-47bb-0310-9956-ffa450edef68
2004-09-18 00:33:56 +00:00
Jeff Trawick
0f0a226ad1 tweak error handling when reading the pid file
previously strtol() would look at unitialized
storage, but now the string is terminated where
the data read ends

give user a hint about removing the file if we can't
read/parse it properly

(somehow I ended up with a truncated httpd.pid on my
own system, leading to these tweaks)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104651 13f79535-47bb-0310-9956-ffa450edef68
2004-08-14 10:49:43 +00:00
Jeff Trawick
c940ea5b58 use existing directive name ThreadStackSize instead of
WorkerStackSize

as made obvious by: Brad Nicholes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102975 13f79535-47bb-0310-9956-ffa450edef68
2004-03-15 23:08:41 +00:00
Jeff Trawick
cb5c3dd6fd Threaded MPMs for Unix and Win32: Add WorkerStackSize directive
to override default thread stack size for threads which handle
client connections.  Required for some third-party modules on
platforms with small default thread stack size.

This is also useful for trimming back the stack size on
platforms with relatively large default stack size in order to
conserve address space for supporting more threads per child.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102931 13f79535-47bb-0310-9956-ffa450edef68
2004-03-11 03:57:50 +00:00
Joe Orton
7bc45b4845 * include/mpm_common.h (ap_pod_t): Remove 'sa' field.
* server/mpm_common.c (ap_mpm_pod_open, dummy_connection): Use
ap_listeners->bind_addr for the dummy connection rather than doing a
name lookup on the first listener's hostname and using one of the
addresses returned.

PR: 27313


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102869 13f79535-47bb-0310-9956-ffa450edef68
2004-03-06 14:50:55 +00:00
Joe Orton
babcd5c7e1 * server/mpm_common.c (ap_process_child_status): Remove an escaped \n
in the error log and add some political correctness.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102772 13f79535-47bb-0310-9956-ffa450edef68
2004-02-25 11:55:31 +00:00
Jeff Trawick
8ab979d28f Add a new directive EnableExceptionHook that must be specified for
exception hooks to be called (in addition to the build time
requirements).

The 2.1-dev feature is now more aligned with the 1.3.30-dev feature,
in that there is a build-time requirement as well as a configuration
requirement.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102686 13f79535-47bb-0310-9956-ffa450edef68
2004-02-19 11:19:43 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
Jeff Trawick
b924ca508a avoid losing a subpool (until restart) on a rare error path
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102420 13f79535-47bb-0310-9956-ffa450edef68
2004-01-27 17:11:04 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Jeff Trawick
a6bc964f24 fix a problem where a crash of a non-MPM child process could
result in an error log message stating that the parent had
crashed

the problem, which affected all *X platforms, was due to an
attempt to support the general problem with linuxthreads;
this change leaves us with a relatively obscure hole when
running on linuxthreads (see comments)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102033 13f79535-47bb-0310-9956-ffa450edef68
2003-12-11 19:05:30 +00:00