1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

379 Commits

Author SHA1 Message Date
Jeff Trawick
611de28cac let's play "name that pool"
(debugging aid...  set the tag on the transaction pool with prefork)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92828 13f79535-47bb-0310-9956-ffa450edef68
2002-01-11 14:13:23 +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
7e0f4e43e1 Add directives to worker and preform MPMs so that the admin can set
the equivalent of HARD_SERVER_LIMIT/HARD_THREAD_LIMIT at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92530 13f79535-47bb-0310-9956-ffa450edef68
2001-12-19 14:49:22 +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
Brian Pane
24960f2199 Use the new pool API to eliminate pool locking in the prefork MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92481 13f79535-47bb-0310-9956-ffa450edef68
2001-12-14 16:20:48 +00:00
Doug MacEachern
bcb88ba28a carry over from 1.3: disable profiling in the parent process #ifdef GPROF
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92230 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 04:06:05 +00:00
Doug MacEachern
a2f3efbd02 fix chdir_for_gprof() to s/dir/use_dir/ for chdir()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92053 13f79535-47bb-0310-9956-ffa450edef68
2001-11-20 18:18:45 +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
a4f00625aa Pull lingering close out of the pool cleanup phase. This was causing too
many bugs.  Instead, it is called where it used to be called.  I have
abstracted some of the logic out of the lingering close so that it gets
the socket from the connection using the core's conn_config vector.  This
is in anticipation of a change to use a hook for the lingering close,
which I hope to do soon.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91968 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:49:54 +00:00
Ryan Bloom
91aa604600 Allow modules that add sockets to the ap_listeners list to
define the function that should be used to accept on that
socket.  Each MPM can define their own function to use for
the accept function with the MPM_ACCEPT_FUNC macro.  This
also abstracts out all of the Unix accept error handling
logic, which has become out of synch across Unix MPMs.

The code flow is much easier now for different transports:

1)  During pre-config, post-config or while parsing the config
    file, add a socket to the ap_listeners list, making sure to
    define an accept function at the same time.

2)  MPMs find the correct listener, and call the accept function
    that was defined in step 1.

3)  That accept function returns a void pointer, which is passed
    to the create_connection hook.

4)  create_connection adds the correct low-level filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91916 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 22:42:38 +00:00
Ryan Bloom
695081280d Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91913 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:29:54 +00:00
Ryan Bloom
ccb09e13da don't use a variable named stat, it can cause problems on some platforms.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91912 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:15:10 +00:00
Ryan Bloom
3d76585bad Back out my last patch. The logic to add sockets to pollsets is back in
the MPM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91906 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 17:44:07 +00:00
Ryan Bloom
a47ed5762d This allows modules to add socket descriptors to the pollset. I have
only added this to the perfork MPM, and the others work without it.
Tomorrow I will add it to the other MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91899 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 07:15:36 +00:00
Ryan Bloom
aefc6b1525 Remove commas from the end of the macros that define
directives that are used by MPMs.  Previous to this patch,
you would use these macros without commans, which was unlike
any other directives. Now, after the macro, you must have
a comma.  This makes the macros look more like the rest of the
directives.

I know this is cosmetic, and I was going to leave it alone, but when
I found out that it bothered Cliff too, I decided to fix it after all.

Submitted by:	Ryan Bloom and Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91896 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 06:04:25 +00:00
Ryan Bloom
26444e2900 Remove more network logic from the MPMs. Essentially, each MPM can define
AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK, which tells Apache to disable_nagle
on the accepted socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91889 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 01:24:42 +00:00
Ryan Bloom
0c05b625ac Begin to abstract out the underlying transport layer.
The first step is to remove the socket from the conn_rec,
the server now lives in a context that is passed to the
core's input and output filters. This forces us to be very
careful when adding calls that use the socket directly,
because the socket isn't available in most locations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
Jeff Trawick
fd7c16969e minor tweaks to pass a parm of the right type to apr_poll() and
to use i for an iterator in both listensocks[] loops


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91850 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 05:17:51 +00:00
Jeff Trawick
7e1daf6e51 in prefork, listensocks[0] doesn't have a pod
also, fix an ap_log_error() call to use ret for the error code
instead of errno


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91849 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 04:37:11 +00:00
Ryan Bloom
13cf9521f5 Remove ap_lingering_close from all of the MPMs. This is now done as
a cleanup registered with the connection_pool.  I have also turned
ap_lingering_close into a static function, because it is only used
in connection.c.  This is the next step to consolidating all of the
socket function calls.  ap_lingering_close will only be added if the
core is dealing with a standard socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91832 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 18:26:30 +00:00
Ryan Bloom
42800272ed Move prefork to the same API as the rest of the MPMs for setting up
listeners.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91829 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 08:00:41 +00:00
Cliff Woolley
4421663d68 Fix the spelling of the AP_MPMQ_MIN_SPARE_DAEMONS and
AP_MPMQ_MAX_REQUESTS_DAEMON macros.  Better to do it now rather than later.

**WARNING** This will of course break the compile on any third-party MPMs
you might have floating around, but it's a really quick change to make.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91777 13f79535-47bb-0310-9956-ffa450edef68
2001-11-07 05:29:58 +00:00
Cliff Woolley
becb75a854 These comments are pretty much useless now AFAICT.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91758 13f79535-47bb-0310-9956-ffa450edef68
2001-11-06 03:43:19 +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
Jeff Trawick
b9c5fa38be Exit when we can't listen on any of the configured ports. This
is the same behavior as 1.3, and it avoids having the MPMs to
deal with bogus ap_listen_rec structures.

This also backs out some circumventions I and Greg Ames had added
to prefork; these are no longer necessary because of this change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91494 13f79535-47bb-0310-9956-ffa450edef68
2001-10-16 18:45:16 +00:00
Greg Ames
db8132bab4 fix another seg fault.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91431 13f79535-47bb-0310-9956-ffa450edef68
2001-10-11 16:28:23 +00:00
Jeff Trawick
4f78b345b2 prefork: Don't segfault when we are able to listen on some but
not all of the configured ports.

Other points to ponder:

  why no log message for the segfault?

  similar change would seem to be needed in other MPMs...  we
  may be adding bogus entries to the poll set


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91399 13f79535-47bb-0310-9956-ffa450edef68
2001-10-10 15:12:12 +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
Justin Erenkrantz
3c90c3f5f4 Add -X functionality back to httpd.
- Updates upgrading.html
- Reverts Aaron's earlier docco patch (sorry...)
- Adds -X to all mpms in the tree


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90824 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 20:50:06 +00:00
Cliff Woolley
80d015aba9 Update the comments regarding -DONE_PROCESS and -DNO_DETACH since
-X doesn't exist anymore.

Submitted by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90790 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 01:00:50 +00:00
Paul J. Reder
c8698ef0db The prefork and OS/2 MPMs are overwriting the pid file when a second copy
of httpd is started and shuts down due to socket conflict. Moving the
call to ap_log_pid solves the problem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90418 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 19:47:52 +00:00
Ryan Bloom
6fdd45dc48 Update the Apache code to account for the XtOffset change in APR.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90356 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 05:48:19 +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
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
5c8e8e3990 record something in the error log if the parent process seg faults
Submitted by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90064 13f79535-47bb-0310-9956-ffa450edef68
2001-08-10 01:34:11 +00:00
Ryan Bloom
3d8f3ce64b Make scoreboard creation a hook. This allows management
modules to have access to the scoreboard at the time that it is
created, and at every restart request.
Submitted by:	Cody Sherr <csherr@covalent.net>
Reviewed by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89608 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 20:45:36 +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
Ryan Bloom
6a04393470 Remove a couple fields from the scoreboard that aren't currently used.
If we need these, they should be added when we begin to use them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89554 13f79535-47bb-0310-9956-ffa450edef68
2001-07-16 02:29:33 +00:00
Jeff Trawick
81d792e5e2 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89531 13f79535-47bb-0310-9956-ffa450edef68
2001-07-10 18:56:55 +00:00
William A. Rowe Jr
7a5c5c4965 Add additional query datum to the MPMs.
Harrie Hazewinkel <harrie@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89433 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 17:43:51 +00:00
Jeff Trawick
058288ed08 add the AcceptMutex directive and related processing to prefork MPM
the directive syntax is as suggested by JimJag a few days ago


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89418 13f79535-47bb-0310-9956-ffa450edef68
2001-06-26 15:13:02 +00:00
Jeff Trawick
1ea247fe52 fix a comment describing how we kill off a single child process
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89416 13f79535-47bb-0310-9956-ffa450edef68
2001-06-26 10:59:16 +00:00
Jeff Trawick
7627b275ab fix some more signalling issues:
. in ONE_PROCESS mode, bail out immediately for SIGHUP and
  SIGINT

  Note that if you send HUP or INT and have cgid then cgid won't
  go away.  If you generate the interrupt signal from the httpd
  terminal then cgid will go away, [I guess] because SIGINT gets sent
  to the process group.  Perhaps just_die() needs to have logic to
  send to other processes in the group for ONE_PROCES mode

. the die_now flag should be static

. please_die_gracefully() is no longer needed


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89369 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 15:46:44 +00:00
Jeff Trawick
ff01b91f5f For SIGHUP in the server processes, we attempt to go away immediately,
just as for SIGTERM.  If we deadlock because of some module or library
issue then SIGKILL will come soon enough.

Stop dorking with SIGTERM and SIGHUP in make_child().  That makes it
kind of hard for the caller to set up for ONE_PROCESS mode.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89368 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 15:26:48 +00:00
Jeff Trawick
d68538c726 fix a bad call to ap_log_error (missing the errno/apr_status_t parameter)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89367 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 14:26:54 +00:00
Jeff Trawick
98b897339d catch SIGWINCH in the parent process and set appropriate flags
so that we write to the pod to tell the servers to go away


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89366 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 14:07:07 +00:00
Jeff Trawick
7a881a69f2 fix a format string used for apr_status_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89365 13f79535-47bb-0310-9956-ffa450edef68
2001-06-14 13:27:37 +00:00
Jeff Trawick
aac11200a9 fix the bindprocessor() code selection; we need to test for the
presence of the bindprocessor() function, not for sys/processor.h,
which exists on some systems that don't have bindprocessor()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89352 13f79535-47bb-0310-9956-ffa450edef68
2001-06-12 14:04:12 +00:00