1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

53 Commits

Author SHA1 Message Date
Yann Ylavic
d2bec9df64 core: ensure that MPMs return an error on runtime failure and hence that
httpd's main process also exits with an error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629925 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 16:54:31 +00:00
Graham Leggett
0aacd9b39d simple MPM: Lift the restriction that prevents mod_ssl taking
full advantage of the event MPM. Enable the ability for a module
to reverse the sense of a poll event from a read to a write or vice
versa.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470683 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 19:50:25 +00:00
Stefan Fritsch
67fde08ec7 Fix usage of MOD_* variables for MPM modules
r1385216 broke building of mpm event with serf support. To fix,

* introduce APACHE_MPMPATH_INIT/FINISH similar to
  APACHE_MODPATH_INIT/FINISH to create modules.mk and add
  MOD_* vars to it.
* change APACHE_MPM_MODULE to only append to modules.mk, not
  overwrite
* add APACHE_MPMPATH_INIT/FINISH to all MPMs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1395252 13f79535-47bb-0310-9956-ffa450edef68
2012-10-07 08:56:45 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Stefan Fritsch
40ac38ff05 Remove MPM-private stuff from conn_state_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204104 13f79535-47bb-0310-9956-ffa450edef68
2011-11-19 23:35:46 +00:00
Paul Querna
c37300112c Fix spelling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200456 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 18:05:47 +00:00
Stefan Fritsch
340375975a Add comment why the code is disabled
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1188951 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 22:32:22 +00:00
Stefan Fritsch
eececab6db Comment out some incomplete code that does nothing but produce a compiler
warning


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1186545 13f79535-47bb-0310-9956-ffa450edef68
2011-10-19 22:40:06 +00:00
Stefan Fritsch
be61728fa5 Check the return value from ap_run_create_connection in mpm_event.
Add a todo in mpm_simple

PR: 41194
Submitted by: Davi Arnaut


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180737 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 22:41:54 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Jim Jagielski
103f776c25 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
Jeff Trawick
5e3ba7d3ee mpm_common.c implements a handful of config directives; the
related state has to be re-initialized to the default values
at pre-config time, but that was handled inconsistently by
the MPMs, resulting in unexpected behavior when some of the
directives were removed across restart

move that necessary initialization from the MPMs to common 
code run from core's pre-config; MPMs that need to override
defaults can do so by running after core's pre-config (the 
NetWare MPM now does that)

the DEFAULT_MAX_REQUESTS_PER_CHILD compile setting wasn't useful
enough to keep

the simple MPM wasn't consistent in which of these directives
were respected and which weren't, and that hasn't changed
(see procmgr.max_requests_per_child vs. ap_max_requests_per_child)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086293 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 16:25:20 +00:00
Rainer Jung
c0ef8bca41 Remove unused header file from simple MPM.
The file was copied in from the event MPM and neither the file
nor any defines in it are referenced in the simple MPM.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@954940 13f79535-47bb-0310-9956-ffa450edef68
2010-06-15 15:48:30 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Jeff Trawick
01026cbc46 remove dead code related to the accept mutex
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@882943 13f79535-47bb-0310-9956-ffa450edef68
2009-11-21 17:18:39 +00:00
Jeff Trawick
330b3351d6 Improve hack to "determine" if APR supports thread-safe pollsets by hiding the
presence of kqueue() on Leopard, matching APR's configuration.

Event and Simple no longer report that they are supported on Leopard, resolving
a broken default config file with --enable-mpms-shared=all on that platform.
(Event was loaded by default in httpd.conf, and it failed at startup when it 
failed to obtain a thread-safe pollset.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@836165 13f79535-47bb-0310-9956-ffa450edef68
2009-11-14 13:01:43 +00:00
Jeff Trawick
d4e7b85b2f Change the configure-based MPM build mechanism to support building
an MPM as a shared shared or dynamic module, primarily using the
APACHE_MPM_MODULE() function.

--enable-mpms-shared now builds/installs the MPMs as dynamic modules.
(But no LoadModule directives are added.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832434 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 14:36:48 +00:00
Jeff Trawick
33e15a38e8 more configure-time support for dynamically loadable MPMs:
. axe --with-mpm="shared" hack, replace with --enable-mpms-shared={all|list}
. replace singular MPM_NAME with access to the list of enabled MPMs
. replace singular MPM_SUBDIR with list MPM_SUBDIRS
. enable OS/2 MPM in same manner as others with configure support instead of
  hard-coding in configure.in

Current state: MPMs are built as static archives (but not linked to httpd) with
--enable-mpms-shared, so they still have to be built with apxs to load 
dynamically.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832228 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 00:38:06 +00:00
Paul Querna
8d9272cd92 * server/mpm/simple/simple_run.c
(simple_setup_pollcb): If the pollset was created successfully, break out of the loop :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@789071 13f79535-47bb-0310-9956-ffa450edef68
2009-06-28 08:30:07 +00:00
Paul Querna
ec9a41f2da Only remove sockets from the pollcb when they have events being polled for.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@789067 13f79535-47bb-0310-9956-ffa450edef68
2009-06-28 08:18:37 +00:00
Paul Querna
410f6fc6f3 server/mpm/simple/simple_run.c
(simple_setup_pollcb): Only pollcbs created using KQueue, EPoll or Event Ports operate correctly with removing sockets across threads.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@789064 13f79535-47bb-0310-9956-ffa450edef68
2009-06-28 08:13:43 +00:00
Jeff Trawick
413ce35a0e Move logic to decide if an MPM is supported, and whether the MPM is
threaded, down to the MPM itself.
  (server/mpm/FOO/config.m4, which runs before the actual MPM selection)

server/mpm/config.m4 makes some general platform checks that can be used
for MPM decisions, and contains some functions related to MPMs.

  XXX The check here for whether APR_POLLSET_THREADSAFE is available
      is a rough approximation and needs to be replaced by a run-time
      check.

Replace the limited per-platform hard-coded MPM selection and the
current defaulting to event (whether or not it works) with a selection
based on which MPMs work on the platform, as reported by the MPMs 
themselves.
  (config2.m4, which runs after the MPMs record whether they are supported)

  Order of preference:

  WinNT (mingw32 only)
    then Event
      then Worker
        then Prefork



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@766082 13f79535-47bb-0310-9956-ffa450edef68
2009-04-17 16:59:48 +00:00
Jeff Trawick
d1c3416282 main() can use ap_run_mpm() directly, so axe the old ap_mpm_run() function
change the mpm hooks to return OK/DONE instead of 0/1


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@762127 13f79535-47bb-0310-9956-ffa450edef68
2009-04-05 17:54:22 +00:00
Jeff Trawick
0acd50d150 clean up apr_time_from_msec() compatibility macros
* where needed, base on APR_VERSION_AT_LEAST() so we remember what this is about
* where not, axe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761084 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 22:06:49 +00:00
Jeff Trawick
23ac01a833 mpm-query hook: distinguish between DECLINED and APR_ENOTIMPL so that
. ap_mpm_query() can return APR_EGENERAL if called too early (for debugging a module)
. some hypothetical module which implements the mpm-query hook can bypass the MPM
  with APR_ENOTIMPL


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760864 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 11:53:50 +00:00
Jeff Trawick
fb6a306876 rename the new retained-data APIs to ap_retained_data_create()/ap_retained_data_get(), for better
consistency with existing APIs (e.g., slotmem)

don't bother changing the MMN, which doesn't reflect recent -dev changes anyway


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759924 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 11:27:53 +00:00
Jeff Trawick
5872c0a54c resurrect the old (pre-r757867) compiled-in MPM_NAME value, but via a hook for dynamically
linked MPMs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758312 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 15:46:56 +00:00
Jeff Trawick
c7266edf61 The rewrite-args hook isn't available to MPM DSOs. Piggy-back on the
linked-in mod_unixd.c to handle that.

(The set of MPMs modified is the same set for which mod_unixd is enabled,
which is approximately equivalent to the set of Unix MPMs which anybody has
tried to maintain in recent memory.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758278 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 14:50:24 +00:00
Jeff Trawick
02e79daf0e change the allocation path for the simple MPM's retained data, as a dynamically
loadable MPM can't use the rewrite-args hook

(note across the table: the hooker hook has no retcode feedback, so I didn't init
the data there)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758224 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 11:23:29 +00:00
Jeff Trawick
92a26cdd3a fix function names in trace messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758223 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 11:17:08 +00:00
Jeff Trawick
fb89b98641 header file tweaks required for compilability
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758178 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 08:43:28 +00:00
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
Paul Querna
69f2fd40dc Add conn_rec::current_thread.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@742218 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 00:57:58 +00:00
Rainer Jung
78b12a1e1a Clean up thread and process number defaults
for simple mpm.

- Before, simple wouldn't start without explicit
  config, because default numbers were 0
- log messages "more" and "less" were misleading


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@730873 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 00:03:48 +00:00
Rainer Jung
9e7431b072 Include mpm_common.h in simple_run.c in order
to resolve ap_run_drop_privileges.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@730777 13f79535-47bb-0310-9956-ffa450edef68
2009-01-02 16:37:44 +00:00
Paul Querna
beacc171b7 Make sure we clear out previous things we were listening for.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@710111 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 17:41:00 +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
7283c2d9e5 Convert events to have an associated pool.
* server/mpm/simple/simple_types.h
    (simple_timer_t): Add Pool and a pointer to the associated simple core.
    (simple_core_t): Remove dead timer ring, no recycling of timer events for now.

* server/mpm/simple/simple_event.h: Update register_timer signature with pool.

* server/mpm/simple/simple_event.c
    (simple_register_timer): Allocate the event structure out of the pool,
        and when this pool is destroyed, unregister the timer.
    (simple_timer_run): New util function for running a timer and cleaning up 
        the pool callbacks.

* server/mpm/simple/simple_core.c
    (simple_core_init): Remvoe dead timer ring

* server/mpm/simple/simple_run.c
    (simple_main_setup_timers): Pass in pool to register call.
    (simple_timer_invoke): Use new simple_timer_run function.
    (simple_child_loop): Remove dead timer ring.

* server/mpm/simple/simple_io.c
    (simple_io_process): Pass in pool when registering timers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709657 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 07:13:29 +00:00
Paul Querna
2f01a7c687 Reset the timers when in the child -- this prevents a fork bomb, as each child would spawn N more children of its own, as the scheduled timer would go off in the child and the parent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709655 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:14:12 +00:00
Paul Querna
9a702bf031 Remove extra log line with how many threads are being spawned.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709654 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:03:39 +00:00
Paul Querna
eac12b8b18 Move creation of the pollcb object to after we fork(), since kqueues don't persist across fork(). (huh, didn't know that before)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709653 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:02:01 +00:00
Jim Jagielski
76746c09e9 Make a valid prototype
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709229 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 19:29:18 +00:00
Paul Querna
9c0569735d Basic support for spawning children porcesses via fork() and killing them with kill().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709136 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 10:46:58 +00:00
Paul Querna
5ac9eeb4bb Remove completed todo items.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709079 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 01:52:35 +00:00
Paul Querna
a67dbf6233 reindent according to our coding style: <http://httpd.apache.org/dev/styleguide.html>
for i in `ls *.h *.c`; do indent -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut ${i}; done


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709078 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 01:50:09 +00:00
Paul Querna
0817768963 Create a new drop_privileges hook for the Simple MPM.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709062 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 00:54:02 +00:00
Paul Querna
2d975344e4 Remove SimpleUser configuration command, this will all be handled inside mod_unixd.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709060 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 00:39:19 +00:00
Nick Kew
dd35c784d6 Introduce modules/system, and mod_unixd.c
mod_unixd.c is only os/unix/unixd.c, turned into a module.
(or more accurately, an ugly hack).  Work in progress, and the
old unixd will have to go once the module build stuff is in place.

This re-introduces some of the unixd stuff (set user, group and chroot)
to mpm_simple, and should work equally well with existing MPMs.
It also paves the way for alternative privilege management schemes,
which can be implemented in alternative modules: this´ll be
necessary to run mpm_simple on non-unix-family platforms, and
of interest for alternative Unix implementations.  By relegating
everything to a child_init hook, we can mix-and-match, though
weĺl need to add a regime that prevents just going right ahead
with nothing and running as root.

Round tuits permitting, we should be able to simplify unixd.h too,
and look towards eliminating it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708935 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 16:41:10 +00:00
Paul Querna
5f24c39a09 Improve ability to compile on C90 Compilers.
* Move all variable declartions to the top of their blocks.
* Remove traiing comma on enum
* Only use C90 style comments.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708813 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 07:56:19 +00:00
Paul Querna
e6583a6303 * server/mpm/simple/simple_io.c: s/simple_io_timeut_cb/simple_io_timeout_cb/g
Noticed by: Ruediger Pluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708707 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 22:43:04 +00:00