Commit Graph

225 Commits

Author SHA1 Message Date
4aca2baf90 core: Follow up to r1902728: ap_max_mem_free early setting.
Set ap_max_mem_free at static initialization time so that the main thread,
created early from init_process(), has some (default) limits for its pool.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1903523 13f79535-47bb-0310-9956-ffa450edef68
2022-08-18 10:44:52 +00:00
2e239ed8e6 * core/mpm: add hook 'child_stopped` that gets called when the MPM has
stopped all processing in a child process. This is when all running
    threads shall be stopped and joined.
    [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898369 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:53:53 +00:00
19360d53df * core/mpm: add hook 'child_stopping` that gets called when the MPM is
stopping a child process. The additional `graceful` parameter allows
    registered hooks to free resources early during a graceful shutdown.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891919 13f79535-47bb-0310-9956-ffa450edef68
2021-07-31 13:36:19 +00:00
c9472d3fc9 Follow up to r1879449: yet better MPM poll callback API.
Let pass a const pfds to the MPM, for it to make a copy on the given pool
as needed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879451 13f79535-47bb-0310-9956-ffa450edef68
2020-07-02 15:49:53 +00:00
ec2c547006 mpm_common: add pool argument to mpm_register_poll_callback[_timeout] hooks.
This is cleaner API than using pfds->pool implicitely.

MAJOR bump but reusing the existing hooks (with an API/ABI breakage) because
it's trunk material only.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879449 13f79535-47bb-0310-9956-ffa450edef68
2020-07-02 15:06:23 +00:00
6f6cc1d2be mpm_common: remove ap_mpm_unregister_poll_callback().
It's now called automatically by mpm_event and anyway can't be called safely
outside the MPM code without racing.

MAJOR bump.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879422 13f79535-47bb-0310-9956-ffa450edef68
2020-07-02 00:33:46 +00:00
ed52157949 mod_status: Cumulate CPU time of exited child
processes in the "cu" and "cs" values.
Add CPU time of the parent process to the
"c" and "s" values.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837595 13f79535-47bb-0310-9956-ffa450edef68
2018-08-07 13:04:05 +00:00
294165b5a7 Fix some doxygen warning.
Make the use of 'pfds' and 'pds' consistent

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1746189 13f79535-47bb-0310-9956-ffa450edef68
2016-05-30 20:19:41 +00:00
7c6d768d77 reverting the reverting of r1735174, r1735176 was the culprit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735227 13f79535-47bb-0310-9956-ffa450edef68
2016-03-16 13:09:47 +00:00
9a54010ad2 reverting r1735174 as http/1.1 just terminated before response
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735216 13f79535-47bb-0310-9956-ffa450edef68
2016-03-16 11:06:28 +00:00
008d76cc3f mpm: Generalise the ap_mpm_register_socket functions to accept pipes or sockets.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735174 13f79535-47bb-0310-9956-ffa450edef68
2016-03-15 22:52:51 +00:00
64eaf888e9 core: Extend support for setting aside data from the network input filter
to any connection or request input filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734656 13f79535-47bb-0310-9956-ffa450edef68
2016-03-12 00:43:58 +00:00
84051c1c9f mpm: Add a complete_connection hook that confirms whether an MPM is allowed
to leave the WRITE_COMPLETION phase. Move filter code out of the MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731253 13f79535-47bb-0310-9956-ffa450edef68
2016-02-19 15:00:05 +00:00
1ef60cdf14 Remove some useless 'return' statements.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715585 13f79535-47bb-0310-9956-ffa450edef68
2015-11-21 22:20:54 +00:00
25a2e41ea7 Save a few bytes in conf pool when parsing some directives. Use temp_pool when applicable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657692 13f79535-47bb-0310-9956-ffa450edef68
2015-02-05 21:03:04 +00:00
3d83bde5ef Revert r1601943, r1602058, r1605307 (socket callback returning pollfds)
Revert r1605369 (wstunnel refactoring)

per discassion on dev@httpd.a.o thread Message-ID:
<CALK=YjN9HfThP_k_rF9iJPcUhcQk9sNOaDPxZNG+HcJNWS4ZAQ@mail.gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1605946 13f79535-47bb-0310-9956-ffa450edef68
2014-06-27 04:17:30 +00:00
0e4cf76a64 Socket event callback now takes pollfd.
User (e.g. mod_proxy_wstunnel) can know
which socket is ready.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601943 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 16:39:34 +00:00
fba67798ed PR56333: Add an API to resume a connection that a handler has previously suspended.
Submitted by: Artem <artemciy gmail.com>, Edward Lu <Chaosed0 gmail.com>
Committed by: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593860 13f79535-47bb-0310-9956-ffa450edef68
2014-05-11 20:52:32 +00:00
d758951456 Extend the socket callbacks in event to allow a timeout on the I/O callback.
When a socket callback has a timeout, an associated timer event is used to 
remove the sockets from the pollset and call a timeout function.

* This includes a noteworthy change to the main event loop. Previously,
we would call epoll, then process the timer events, then iterate through the
poll results. After this patch, the timer events are processed before the poll()
a _non-queued_ action can change the pollset conents (a users timed callback
function conversely could easily sit in a queue while the main thread continues
down into epoll)

* timer events can now have sockets associated with them, those sockets are 
removed from the pollset when the timer event fires w/o a queue to the worker.

* timer events now have a canceled flag that can be toggled without locking
the timer list. 

* Drop the severity of some wstunnel messages from DEBUG to TRACE1

* Lift the restriction on using asynchronous websockets connections but having
an idle timeout



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593857 13f79535-47bb-0310-9956-ffa450edef68
2014-05-11 20:41:45 +00:00
58f5ac2464 avoid duplication of APR_HOOK_LINK invocations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546836 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 18:51:04 +00:00
a135988f0c Follow-up to r1546759: Fix compilation when exception hooks aren't enabled.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546835 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 18:46:56 +00:00
540be85c46 Add suspend_connection and resume_connection hooks to notify modules
when the thread/connection relationship changes.  (Currently implemented
only for the Event MPM; should be implemented for all async MPMs.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546759 13f79535-47bb-0310-9956-ffa450edef68
2013-11-30 17:56:25 +00:00
2ab496bc50 Fix potential rejection of valid MaxMemFree and ThreadStackSize
directives.

Submitted by: Mike Rumph <mike.rumph oracle.com>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542338 13f79535-47bb-0310-9956-ffa450edef68
2013-11-15 17:35:16 +00:00
f632ed1df1 Fold in Eric Covener's socket callback
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1493741 13f79535-47bb-0310-9956-ffa450edef68
2013-06-17 12:43:52 +00:00
b6f86b92c2 The Pidfile directive and ap_log_pid()/ap_remove_pid()/ap_read_pid()
now respect DefaultRuntimeDir


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369808 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 12:15:03 +00:00
2e728d6ee5 Revert r1294936 (Jeff's revert) and fix NetWare / Win32 build.
Added the missing AP_DECLARE* decorations for the function 
implementations and variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1303201 13f79535-47bb-0310-9956-ffa450edef68
2012-03-20 23:15:05 +00:00
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
99bf95deb5 Folloup on r1201158: New MaxMemFree was meant
to be 2048, not 4096.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201202 13f79535-47bb-0310-9956-ffa450edef68
2011-11-12 05:59:13 +00:00
253d865fe4 Set MaxMemFree 2048 by default
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201158 13f79535-47bb-0310-9956-ffa450edef68
2011-11-12 01:54:50 +00:00
5405226ae2 end-generation hook: Fix false notification of end-of-generation for
temporary intervals with no active MPM children.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200449 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 17:46:57 +00:00
7c5a4c2bc9 Call apr_random_after_fork() manually in the child processes because the MPMs
use plain fork() and not apr_proc_fork().
Also add some workaround for APR not changing the RNG state in the parent.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198868 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 18:46:47 +00:00
b5aafabf63 Consistently use base 10 for numbers when parsing config options. It may be
confusing to the user if some directives treat a number with leading zero as
octal while most don't.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180687 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 18:58:21 +00:00
0ddfb3e6cc Add -D DUMP_RUN_CFG option to dump some configuration items
from the parsed (or default) config. This is useful for init scripts that
need to setup temporary directories and permissions, for example if those
temporary directories are located on a ram disk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180681 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 18:35:23 +00:00
6327f51ed2 Export ap_max_mem_free, needed by r1178079, as pointed out by Gregg L. Smith
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1179448 13f79535-47bb-0310-9956-ffa450edef68
2011-10-05 21:25:58 +00:00
a78fbca9ac * server/mpm_common.c (ap_core_child_status): Allocate the geninfo,
unused_geninfo ring heads from the heap; fixing gcc aliasing
  warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1143469 13f79535-47bb-0310-9956-ffa450edef68
2011-07-06 15:40:17 +00:00
4b3f0aaf96 Log the deprecation warning at level info, not warn
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137813 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 22:57:24 +00:00
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
7eb4cae399 disable hook probes for our two hooks which have no args
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101671 13f79535-47bb-0310-9956-ffa450edef68
2011-05-10 22:52:45 +00:00
462c69e0b5 Add child_status hook for tracking creation/termination of MPM child
processes.  Add end_generation hook for notification when the last
MPM child of a generation exits.

end_generation is implemented completely by core using the
child_status hook run by the MPM.

simple and mpmt_os2 MPMs don't currently run the child_status
hook, so neither hook is invoked with those MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 21:21:22 +00:00
544697d7c3 Abort if the MPM is changed across restart.
A new MPM can't be expected to manage the existing state,
particularly if that includes processes from the previous
generation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1089472 13f79535-47bb-0310-9956-ffa450edef68
2011-04-06 14:49:45 +00:00
3c0476fe50 Simplify the interface to ap_reclaim_child_processes() and
ap_relieve_child_processes(): instead of requiring the MPM
to implement an otherwise-useless hook, just use a callback
function.

As I don't expect third-party MPM devs are following our day
to day progress, the API changes are considered part of
yesterday's MMN change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087085 13f79535-47bb-0310-9956-ffa450edef68
2011-03-30 21:32:10 +00:00
b1e1cff7f9 the mpm-note-child-killed hook was just for use by
ap_{reclaim,relieve}_child_processes; those functions can
invoke the hook directly; the function ap_mpm_note_child_killed()
is useless


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086953 13f79535-47bb-0310-9956-ffa450edef68
2011-03-30 13:42:00 +00:00
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
72456d0231 use apr_time_from_sec() shortcut
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1085779 13f79535-47bb-0310-9956-ffa450edef68
2011-03-26 18:36:11 +00:00
059c3cafd7 Added prototype for initgroups().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082250 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 18:30:40 +00:00
5bcd082e3d Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
describes more accurately what the directive does.

The old name still works but logs a warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021924 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 21:12:37 +00:00
8f840cb763 core: Abort with sensible error message if no or more than one MPM is
loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987806 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 18:06:41 +00:00
a527986832 remove more unused variables
revove some obsolete comments

netware file is untested


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 22:12:19 +00:00
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
78cf8c9212 Refactor mod_status out of the ExtendedStatus toggle picture, as other
modules can and should be able to use this scoreboard information.
Rename suggestions for such a directive are welcomed.

Note that mod_status toggles the default, to present the ExtendedStatus 
for server operators, whenever it is loaded.  Docs changes to follow.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@903020 13f79535-47bb-0310-9956-ffa450edef68
2010-01-26 00:05:37 +00:00