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

198 Commits

Author SHA1 Message Date
William A. Rowe Jr
178e10e3da Well the wrappers work out well... nice to be able to put off committing
these API changes until the evening ;)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95587 13f79535-47bb-0310-9956-ffa450edef68
2002-06-09 03:44:03 +00:00
Jeff Trawick
fc658e628b the "-k startssl" parameter is reverted by popular demand
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95269 13f79535-47bb-0310-9956-ffa450edef68
2002-05-24 18:48:10 +00:00
Jeff Trawick
8f135cea77 fix data initialization problem in new Unix -k option processing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95251 13f79535-47bb-0310-9956-ffa450edef68
2002-05-23 18:31:02 +00:00
Jeff Trawick
0547e6e6e9 Add "-k start|startssl|restart|graceful|stop" support to httpd
for the Unix MPMs.  These have semantics very similar to the
old apachectl commands of the same name.

The use of stderr/stdout and exit status for error conditions
needs to be revisited.  For now it matches apachectl behavior.

Justin Erenkrantz got the ball rolling with this feature.  Some
of his support code was used unchanged.  Other code was shuffled
around and modified or rewritten.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95237 13f79535-47bb-0310-9956-ffa450edef68
2002-05-23 12:58:37 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Aaron Bannert
fe3208953d Remove unnecessary includes of apr_lock.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94566 13f79535-47bb-0310-9956-ffa450edef68
2002-04-09 06:48:31 +00:00
Jim Jagielski
cc7157e782 Added support for Posix semaphore-based mutex locking (AcceptMutex posixsem).
It's between pthread and sysvsem in the DEFAULT priority ranking. This
makes it the new default for Darwin, and adds support for it for other
platforms as well (like Solaris).
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94434 13f79535-47bb-0310-9956-ffa450edef68
2002-04-04 18:36:03 +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
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
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
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
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
William A. Rowe Jr
d07e31f81f Simplify s/APR_OS_PROC_T_FMT/APR_PID_T_FMT/, apr_os_foo entities aren't
for external consumption.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93969 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:42:46 +00:00
William A. Rowe Jr
65a37752ec Eliminate potential ap_server_root_relative segfaults, with the input
of Jeff Trawick's style changes to the first patches.  Doesn't include
  the fixes to ssl [more complex], and we won't trap errors that involve
  ap_serverroot, since we presume that was normalized on the way in.
  Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases
  should never become necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93965 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:26:58 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Sander Striker
f91ea17c85 Make this look a bit better.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93843 13f79535-47bb-0310-9956-ffa450edef68
2002-03-11 14:27:45 +00:00
Sander Striker
d694a08ca3 Style Police comming through...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93833 13f79535-47bb-0310-9956-ffa450edef68
2002-03-11 10:48:58 +00:00
Jeff Trawick
2580e70141 don't wait nearly so long for child processes to go away
the adjustment of the wait time was done too soon

now the code should be consistent with 1.3 behavior


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93560 13f79535-47bb-0310-9956-ffa450edef68
2002-02-24 20:41:19 +00:00
Jeff Trawick
b49a2fbe38 close an extremely unlikely file descriptor leak in
dummy_connection()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93479 13f79535-47bb-0310-9956-ffa450edef68
2002-02-18 16:18:10 +00:00
Greg Ames
9ad90284cd if a child detects a resource shortage on accept(), limit the rate of fork()s
to 1 per second until the situation clears up.

Inspired by: Martin Kraemer


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93366 13f79535-47bb-0310-9956-ffa450edef68
2002-02-11 23:20:16 +00:00
William A. Rowe Jr
7e1113f913 This patch eliminated from the _SHARED_ segment of the scoreboard all
pointer math.  This is required for portable scoreboards.

  vhost becomes the 'vhost name string' so it now survives ap_generation
  clicks.  next was apparently never used.

  This patch also accounts for the changes to the apr_shm api, and gives
  Win32 the magic of a shared scoreboard.

  Breakage aplenty on non-win32 platforms, I suspect, but this radical
  surgery, and culling of unused functions, was really, really needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92791 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 00:28:00 +00:00
Jeff Trawick
57b42f96ac handle the disappearance of apr_lock_create_np() and
apr_proc_mutex_create_np() and the new parameter to
apr_lock_create() and apr_proc_mutex_create()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92653 13f79535-47bb-0310-9956-ffa450edef68
2001-12-29 23:16:24 +00:00
Jeff Trawick
187e9ae3b9 Change core code to allow an MPM to set hard thread/server
limits at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92512 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 13:48:54 +00:00
Aaron Bannert
b491e30b1c Fix a bug in how we select the IP for the POD to connect to for dummy
connects (dislodging a doomed child from the accept mutex). No longer
do we assume that the child is listening to 127.0.0.1, but instead
we just pick the first hostname/port from the listen rec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92437 13f79535-47bb-0310-9956-ffa450edef68
2001-12-12 23:56:46 +00:00
Greg Ames
65538c20e3 fix a problem with graceful restart. If you look at daedalus early in the
morning, you will usually see lots ( >50 ) of old generation processes
happily serving requests with yesterday's config.  Late in the afternoon, they
are usually gone due to MaxRequestsPerChild and perform_idle_server_maintenance.

ap_mpm_pod_signal can time out during connect(), causing it to exit with an
error.  If it was called by ap_mpm_pod_killpg during graceful restart,
ap_mpm_pod_killpg will exit immediately.  This can cause us to not write
enough characters to the pod to kill off all the old generation children.

This fix decouples the loop which writes to the pod from the loop which
generates dummy connect()s.  The connect()s aren't as important as
writing to the pod when there is a steady stream of inbound connections.

also, close the socket and destroy the temporary pool if the connect()
fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92411 13f79535-47bb-0310-9956-ffa450edef68
2001-12-10 20:10:05 +00:00
Jeff Trawick
6496d29027 get prototype for strcasecmp() on AIX
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92305 13f79535-47bb-0310-9956-ffa450edef68
2001-12-04 01:04:17 +00:00
Jeff Trawick
477e8bbba8 make sure ap_process_child_status() always returns something
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92020 13f79535-47bb-0310-9956-ffa450edef68
2001-11-17 14:09:14 +00:00
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