1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

121 Commits

Author SHA1 Message Date
Jeff Trawick
502a0a8eb9 Get mod_cgid killed when a MPM exits due to a fatal error.
Presumably other such processes are affected to.  Now we
give main() a chance to clean up.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92019 13f79535-47bb-0310-9956-ffa450edef68
2001-11-17 14:02:26 +00:00
Ryan Bloom
dbb19e0e8c Fix the reporting for child processes that die. This removes
all of the non-portable W* macros from Apache.

Submitted by:	Jeff Trawick and Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91648 13f79535-47bb-0310-9956-ffa450edef68
2001-10-23 17:30:07 +00:00
Justin Erenkrantz
45ed1d06a2 Switch proc_pthread to pthread for the AcceptMutex directive.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91101 13f79535-47bb-0310-9956-ffa450edef68
2001-09-21 14:29:33 +00:00
Greg Stein
3f8e5404e9 Add an extra parameter to all apr_proc_wait() calls for the new "exitcode"
parameter. Pass NULL because we aren't interested in the value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91093 13f79535-47bb-0310-9956-ffa450edef68
2001-09-20 09:03:24 +00:00
Justin Erenkrantz
a8a56e00c5 Switch back to SIGUSR1 for graceful restarts on all platforms that
support it.  This defines a symbol called AP_SIG_GRACEFUL in
ap_config_auto.h which will have the appropriate signal value.  All
direct references to SIGWINCH have been replaced with AP_SIG_GRACEFUL.

On Linux 2.0, use SIGWINCH instead since SIGUSR1 is used by glibc
2.0's user-space threading library to control threads.  All later
versions of Linux/glibc don't have this problem.  (Not to mention the
security holes in older Linux versions which make it unsuitable for
use as a web server.)  If your platform doesn't have SIGUSR1, use the
appropriate mojo in configure to define what your graceful restart
signal should be.

In theory, a configure switch could be added to allow the admin to
specify the appropriate signal that should be used.  This is left
as an exercise to the reader for now.

The docs need to be updated.  Since the signal is now configurable,
just saying SIGUSR1 for graceful restart isn't completely true.  Also,
the apachectl functionality needs to be moved into httpd - this is
what Win32 does and it makes us consistent across platforms.

Roy issued a veto against use of SIGWINCH by default, so this should
resolve that veto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91076 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 22:13:59 +00:00
Bradley Nicholes
164895c4ca Added NetWare to the #ifdef list
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91029 13f79535-47bb-0310-9956-ffa450edef68
2001-09-14 23:28:41 +00:00
Jeff Trawick
aee4f61414 The Unix MPMs other than perchild now allow child server
processes to use the accept mutex when starting as root and
using SysV sems for the accept mutex.  Previously, this
combination would lead to fatal errors in the child server
processes.  perchild can't use SysV sems because of security
issues.

translation: steal apache 1.3 code to call semop(IPC_SET) on
the semaphore to set permissions and uid/gid


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90213 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 13:59:14 +00:00
Jeff Trawick
2b5249df23 namespace-protect accept_lock_mech
fix a bug in the worker MPM which effectively disabled the AcceptMutex
directive


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90153 13f79535-47bb-0310-9956-ffa450edef68
2001-08-14 12:30:50 +00:00
Jeff Trawick
c8809eb467 change the name of AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES to
be more consistent with similar names added recently; this
also cleans up an #if/#ifdef discrepency


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90141 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 18:24:53 +00:00
Jeff Trawick
f29b938e84 (hopefully) get WinNT MPM to build using mpm_common.c code; a few notes:
. the selection of ap_sock_disable() is certainly ugly, but that may
  need to be cleaned up in a different manner...
. the directive functions couldn't be AP_DECLARE() if they are to be
  compatible with AP_INIT_TAKExxx(); this is an old restriction


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90138 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 16:42:13 +00:00
Jeff Trawick
3f770a03df allow non-Unix MPMs to use mpm_common.c by not automatically
building in Unix-specific code


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90137 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 15:44:00 +00:00
Ryan Bloom
8006145310 Begin to sanitize the MPM configuration directives. Now, all
MPMs use the same functions for all common MPM directives.  This
should make it easier to catch all bugs in these directives once.

Everybody should check their favorite MPM to ensure that it still
compiles, and that these directives work.  This is a big patch, and
although it looks good, and things compiled for me, that is no
garauntee that it will work on all platforms.  :-)

Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90132 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 04:57:35 +00:00
Greg Ames
590a1bde98 fix memory leak of apr_sockaddr_t and apr_socket_t in ap_mpm_pod_signal,
called by perform_idle_server_maintenance.

allocate & init one apr_sockaddr_t for the dummy connect at pod open time.
use a temporary subpool for the apr_socket_t


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89612 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 21:16:40 +00:00
Paul J. Reder
620a48e609 Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
daemon index actually used in the scoreboard. I also
updated the pertinent calls.

Paul J. Reder


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89604 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 20:29:00 +00:00
William A. Rowe Jr
b65ca11a4a Changes to back out inherit flag from apr_os_sock_make()
and apr_socket_create()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89592 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 16:56:55 +00:00
Ryan Bloom
44715abbd2 Added an inherit flag to apr_socket_create and other socket creation
functions.  This allows APR programs to specify that a socket should
be passed to any child processes that are created.  The inherit flag
is only meaningful if programs use apr_process_create().  This
also adds a couple of macros that allow APR types to set and unset
the inherit flag.

This also fixes Apache to use the new API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89557 13f79535-47bb-0310-9956-ffa450edef68
2001-07-16 16:11:05 +00:00
Jeff Trawick
5ec8cc24e3 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()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89539 13f79535-47bb-0310-9956-ffa450edef68
2001-07-11 14:48:23 +00:00
Jeff Trawick
c50b9eaa62 back out a change from last week that reversed the meaning of pod_in and
pod_out; after that change, all read and write syscalls on the handles
failed because pod_in was only readable and pod_out was only writable

we could instead reverse the order of the parameters to apr_pipe_create
so that the descriptors returned by pipe() get put in the right place,
but it seems better to stick with APR terminology for what is the input
handle and what is the output handle


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89335 13f79535-47bb-0310-9956-ffa450edef68
2001-06-11 18:23:21 +00:00
Jeff Trawick
107761ea76 pod_in shouldn't be non-blocking after all
Submitted by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89314 13f79535-47bb-0310-9956-ffa450edef68
2001-06-09 02:57:46 +00:00
Jeff Trawick
fa787dcc29 the input handle to the pod (used by child processes) needs to be non-blocking
before this, no requests could be processed by prefork since after connect
from the client prefork would block reading the pod

the write handle to the pod probably doesn't have to be non-blocking, but
getting EAGAIN for the pipe-full condition, rather than blocking, is nice
for now since it would tend to indicate that something is FUBAR; on the other
hand, this probably needs to change in order to support more than 4K workers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89310 13f79535-47bb-0310-9956-ffa450edef68
2001-06-08 16:53:10 +00:00
Ryan Bloom
4ddaac5e95 It helps to write to the input side of the pipe, and read from the output
side.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89303 13f79535-47bb-0310-9956-ffa450edef68
2001-06-08 04:55:44 +00:00
Jeff Trawick
11ce365075 trace failures of a couple of crucial socket calls in ap_mpm_pod_signal()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89296 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 17:22:12 +00:00
Jeff Trawick
e92ae550c7 improve ap_mpm_pod_signal() by not let it loop until it fills the pipe
it still doesn't handle the pipe being full for other reasons (bazillions
of child processes?), but I'm not sure that is a real occurrence


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89294 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 15:18:28 +00:00
Ryan Bloom
931fe85b8d First pass at the pipe_of_death logic for the prefork MPM. This does
pass some initial testing, but it needs to be banged on more.  It looks
like if the server gets a lot of requests to restart all at once, there
are potential problems, but other than that this does seem to solve our
current restart issues.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89282 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 00:09:16 +00:00
Bill Stoddard
1b1538c84d Remove calls to apr_proc_probe_writable_fds(). The function is going away.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89131 13f79535-47bb-0310-9956-ffa450edef68
2001-05-16 20:51:38 +00:00
Jeff Trawick
7ed1b10217 Build (and do so cleanly) when !APR_HAS_OTHER_CHILD.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88986 13f79535-47bb-0310-9956-ffa450edef68
2001-05-04 18:42:51 +00:00
Paul J. Reder
a3d7fb947d Changes required to make prefork clean up idle children properly. There was a window during which a starting worker deadlocks when an idle cleanup arrives before it completes init. Apache then keeps trying to cleanup the same deadlocked worker forever (until higher pids come along, but it still will never reduce below the deadlocked pid). Thus the number of children would not reduce to the correct idle level.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88741 13f79535-47bb-0310-9956-ffa450edef68
2001-04-06 20:12:09 +00:00
Brian Havard
7c7bd950fd Declaration of ap_reclaim_child_processes() in exports.c needs to be
conditional in the same way that the function's definition is so give it a
suitable macro that will be recogized by the scripts that make exports.c.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88537 13f79535-47bb-0310-9956-ffa450edef68
2001-03-19 13:07:28 +00:00
Ryan Bloom
d2d23882af Allow modules to query the MPM about it's execution profile. This
query API can and should be extended in the future, but for now,
max_daemons, and threading or forking is a very good start.

Non-Unix MPM's do have the MPM query function, although there is no
garauntee that the information is perfect, please check.

Submitted by:	Jon Travis <jtravis@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88437 13f79535-47bb-0310-9956-ffa450edef68
2001-03-02 22:46:33 +00:00
Roy T. Fielding
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
Greg Stein
1229603b02 *) remove some obsolete/unused defines from httpd.h.
*) remove DEFAULT_XFERLOG from main.c; it is never set/used
*) move ap_get_max_daemons() to ap_mpm.h
*) move DEFAULT_LISTENBACKLOG to mpm_common.h


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88103 13f79535-47bb-0310-9956-ffa450edef68
2001-02-12 02:49:56 +00:00
Greg Stein
39793c7fca toss the signal description stuff from unixd.[ch], beosd.h, and spmt_os2.
use the new functionality in APR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88079 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 00:44:40 +00:00
Doug MacEachern
88d3406f9a renaming various functions for consistency sake
see: http://apr.apache.org/~dougm/apr_rename.pl
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88019 13f79535-47bb-0310-9956-ffa450edef68
2001-02-08 07:45:33 +00:00
Ryan Bloom
da4502c070 Make the Prefork MPM use SIGWINCH instead of SIGUSR1 for graceful restarts.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87881 13f79535-47bb-0310-9956-ffa450edef68
2001-01-28 01:16:37 +00:00
Brian Havard
8bd414722f Add headers needed for getpwnam & getgrnam prototypes & types.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87777 13f79535-47bb-0310-9956-ffa450edef68
2001-01-21 14:52:12 +00:00
Ryan Bloom
86a67eff47 Move initgroupgs, ap_uname2id and ap_gname2id from util.c to
mpm_common.c.  These functions are only valid on some platforms,
so they should not be in the main-line code.

These functions are also not portable to non-unix platforms, so they don't
really belong in APR.  Since they are only used in MPMs, for right now,
I am moving them to mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87755 13f79535-47bb-0310-9956-ffa450edef68
2001-01-20 06:05:15 +00:00
Greg Stein
ead2dae94c *) Compensate for recent changes in the APR headers. Specifically, some
files need to specifically include stdio.h, or a particular apr_*.h
   header.

*) Adjust callers of apr_create_process() to deal with the extra "const"

*) Add "const" to args of ap_os_create_privileged_process()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87080 13f79535-47bb-0310-9956-ffa450edef68
2000-11-26 04:47:43 +00:00
William A. Rowe Jr
01f4c4f960 The lots of little ones... APR_IS_STATUS_condition(rv) conditional macros
replacing the majority of fallible rv == APR_condition tests.  But there
  are lots more to fix, these are the obvious ones that already did proper
  canonical error conversion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86405 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 17:33:14 +00:00
Brian Havard
7ed141239d APRize disabling nagle (setting TCP_NODELAY).
Note that several areas have not been tested as they apply to MPMs or APR
code that I can't test.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86133 13f79535-47bb-0310-9956-ffa450edef68
2000-08-22 15:09:28 +00:00
William A. Rowe Jr
1a9db204f5 Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation...
see src/lib/apr/apr_compat.h for most details.
  Also a few minor nits to get Win32 to build.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86008 13f79535-47bb-0310-9956-ffa450edef68
2000-08-06 06:07:53 +00:00
Doug MacEachern
059d8dd212 prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85976 13f79535-47bb-0310-9956-ffa450edef68
2000-08-02 05:27:38 +00:00
Manoj Kasichainula
5f0b2584a4 Eliminate references to specific MPMs from mpm_common.c by having the
MPMs export interfaces to the tables used to keep track of children.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85951 13f79535-47bb-0310-9956-ffa450edef68
2000-07-30 12:03:48 +00:00
Manoj Kasichainula
de6d7efcca Change semantics of ap_child_table somewhat. Instead of checking for a
dead process with status == SERVER_DEAD, check with pid == 0. This
makes somewhat more sense conceptually, and also matches the behavior
of MPMs that use a shmem scoreboard to track children.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85950 13f79535-47bb-0310-9956-ffa450edef68
2000-07-30 11:49:29 +00:00
Ryan Bloom
4adecb112e Add a new MPM. Currently this is almost an exact copy of the dexter MPM.
In time, this will be the MPM that allows each child process to have a
unique user id.  I need a place to work and keep track of my changes.
Don't expect this to work until next week sometime.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85902 13f79535-47bb-0310-9956-ffa450edef68
2000-07-27 00:16:32 +00:00
Ryan Bloom
a123234f7b Cleanup the MPM #defines. Each MPM #defines a unique name that identifies
it to the system.  That name should be of the format NAME_MPM where name
is something like DEXTER, MPMT_PTHREAD, SPMT_OS2, etc.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85901 13f79535-47bb-0310-9956-ffa450edef68
2000-07-27 00:04:11 +00:00
Jeff Trawick
f34f4329b7 Fix some build issues for dexter:
. dexter/scoreboard.c needed apr_strings.h to get the right
  function prototypes

. main/mpm_common.c needed to recognize that we were building
  for dexter; otherwise, no ap_reclaim_child_processes() was
  compiled and linking failed

(It would be nice to standardize on which preprocessor symbols
are checked for...  mpmname_MPM seems nice enough.  Didn't the
check for symbol mpmname (no "_MPM") come with mpmt.c?)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85899 13f79535-47bb-0310-9956-ffa450edef68
2000-07-26 18:07:34 +00:00
Jeff Trawick
f0bb3353e6 Get ap_socket_disable_nagle() working again.
Submitted by:	Greg Ames
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85894 13f79535-47bb-0310-9956-ffa450edef68
2000-07-26 14:12:38 +00:00
William A. Rowe Jr
847b20108c Add APR_EOL_STR for a platform specific text delimiter, provided by
apr.h (defined in apr.h.in and apr.hw).  This is needed -only- in APR
  created files (true raw files) such as logs.  It is not required in any
  splat to screen (stderr/stdout) formatting, nor any html markup.

  Some other modules slipped through in the prior apr_strings.h commit.
  Sorry 'bout that.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85878 13f79535-47bb-0310-9956-ffa450edef68
2000-07-25 01:06:32 +00:00
Bill Stoddard
c4aeab10dc #ifdef APR_HAS_OTHER_CHILD to #if APR_HAS_OTHER_CHILD. Not tested.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85821 13f79535-47bb-0310-9956-ffa450edef68
2000-07-11 22:12:18 +00:00
Ryan Bloom
ffd0a49e40 Remove all pthreads calls from the mpmt MPM prefork emulation. This makes
the mpmt MPM look almost exactly like the original prefork MPM.  Basically,
all that's left is re-naming the defined directives so they work with 1.3
config files.  That will come later.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85819 13f79535-47bb-0310-9956-ffa450edef68
2000-07-11 19:00:16 +00:00