summaryrefslogtreecommitdiffstats
path: root/server/mpm_unix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert r1821526, r1821527, r1821534, r1821538, r1821539, r1821541, r1821605, ↵Yann Ylavic2018-01-191-528/+2
| | | | | | | | | | | | | | r1821607, r1821608. Instead of copying event/fdqueue.c code into existing mpm_unix.c, losing all contributors (blame, since r105919...), will restart the series by svn-moving event/fdqueue.[ch] to server/mpm_fdqueue.[ch] first. The code is not really unix specific either, so this sounds better. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821619 13f79535-47bb-0310-9956-ffa450edef68
* mpm_unix: Follow up to r1821526.Yann Ylavic2018-01-191-8/+15
| | | | | | | | | Prepare mpm_worker to use common fdqueue. [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821607 13f79535-47bb-0310-9956-ffa450edef68
* mpm_unix: Follow up to r1821526.Yann Ylavic2018-01-191-4/+6
| | | | | | | | | Clear recycled_pools_count in ap_free_idle_pools(). [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821605 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1821526: rename ap_queue_info_get_idlers to ↵Yann Ylavic2018-01-181-1/+1
| | | | | | | | | ap_queue_info_num_idlers. [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821541 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1821526: style, no functional change.Yann Ylavic2018-01-181-30/+26
| | | | | | | [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821539 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1821526: opacify fdqueue types.Yann Ylavic2018-01-181-4/+11
| | | | | | | [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821538 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1821526: mpm_unix.h needs this includes only for now.Yann Ylavic2018-01-181-2/+1
| | | | | | | [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821534 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1821526: mpm_unix.hYann Ylavic2018-01-181-3/+3
| | | | | | | | | | The fdqueue code is not for WIN32 (per mpm_unix.c), and does not seem to require all the #includes (system) it claimed (at least in .h). [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821527 13f79535-47bb-0310-9956-ffa450edef68
* Share fdqueue code between MPMs event and worker.Yann Ylavic2018-01-181-0/+515
| | | | | | | | | | | | | This first step moves the content of server/mpm/event/fdqueue.c to the existing server/mpm_unix.c file, and the server/mpm/event/fdqueue.h file to trunk/server/mpm_unix.h (untouched for now, simple svn move). Will follow up with the necessary changes to mpm_unix.* for common code. [Reverted by r1821619] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821526 13f79535-47bb-0310-9956-ffa450edef68
* core, MPMs unix: follow up to r1809881.Yann Ylavic2017-09-281-0/+29
| | | | | | | | | | | | | | | | | | Deregister all hooks first (in pre_cleanup), by doing it last we could still have had them run when DSOs were unloaded. Likewise, avoid double faults when handling fatal signals by restoring the default handler before pconf is cleared (we can't ap_log_error there). Finally, we need to ignore sig_term/restart (do nothing) when the main process is exiting (i.e. ap_pglobal is destroyed), since retained_data are freed. Aimed to fix all faults in PR 61558. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809973 13f79535-47bb-0310-9956-ffa450edef68
* MPMs unix: Place signals handlers and helpers out of DSOs to avoidYann Ylavic2017-02-211-2/+1
| | | | | | | | | a possible crash if a signal is caught during (graceful) restart. PR 60487. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783849 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1783759: really more things than intended :pYann Ylavic2017-02-201-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783760 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1783755: update APLOGNO.Yann Ylavic2017-02-201-2/+1
| | | | | | [Reverted by r1783760] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783759 13f79535-47bb-0310-9956-ffa450edef68
* ap_reclaim_child_processes(): Implement terminate immediatelyStefan Fritsch2016-11-211-11/+21
| | | | | | | | | | The behavior for terminate == 1 was documented but not implemented. Do that now. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770750 13f79535-47bb-0310-9956-ffa450edef68
* mpm_unix: Apache fails to start if previously crashed then restarted withYann Ylavic2016-10-211-1/+4
| | | | | | | | | | the same PID (e.g. in container). PR 60261. Proposed by: Val <valentin.bremond gmail.com> Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1766160 13f79535-47bb-0310-9956-ffa450edef68
* ap_reclaim_child_processes() ignores its first argumentStefan Fritsch2016-08-211-0/+1
| | | | | | | note this in the docs, add comment git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757061 13f79535-47bb-0310-9956-ffa450edef68
* Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygenWilliam A. Rowe Jr2016-06-091-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
* Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).Yann Ylavic2015-11-231-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1715789: will re-commit without spurious functional changes.Yann Ylavic2015-11-231-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
* Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).Yann Ylavic2015-11-231-2/+2
| | | | | | | [Reverted by r1715869] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
* MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531Yann Ylavic2014-10-301-77/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | less intrusive. Submitted by: Yingqi Lu <yingqi.lu@intel.com> Modified/Committed by: ylavic Add ListenCoresBucketsRatio which is a configurable ratio between the number of CPU cores (online) and the number of listeners buckets to create, defaulting to zero (so that listeners buckets become an opt-in, ie. ncpus / ratio > 1). This could also be made an opt-out by using the previous hardcoded value (8) as default. Make ap_close_listeners() act on all the listeners (including duplicated ones), since the function is also called externally (eg. mod_cgid, mod_ssl_ct and possibly any third party module) to cleanup opened descriptors when a process is forked (the duplicated listeners are kept in a scoped/static variable). Add ap_close_listeners_ex() to close a single bucket of listeners, used by the children to close unused duplicates and internally by ap_close_listeners(). Make ap_duplicate_listeners() compute the number of buckets to be used, instead of each MPM. This number is now based on the above ratio and will not change unless asked to (given *num_buckets < 1, that is when the MPM does not run in one-process mode nor after a graceful restart). Remove some global variables (mpm_listen, enable_default_listeners) previously used to communicate between MPMs and ap_listen, since ap_duplicate_listeners() API can now be used to do so. Also rename num_buckets as ap_num_listen_buckets, and prefix have_so_reuseport with ap_ (both printed by ap_log_common(), hence kept global). Detect ap_have_so_reuseport once only at startup. Restore dummy_connection() as before r1599531 since sending POD signals should not depend on the number of listeners buckets (there is still one single socket receiving the connections). For each MPM (concerned), move the bucket data (pod, listeners and eventually accept mutex) into a struct and instanciate an array of them (sized by the number of buckets), for each child to use its own data according to its bucket index, and the parent to maintain the whole. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635521 13f79535-47bb-0310-9956-ffa450edef68
* prepend 0Jim Jagielski2014-09-181-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1625953 13f79535-47bb-0310-9956-ffa450edef68
* Optimize w/ duplicated listeners and use of SO_REUSEPORTJim Jagielski2014-06-031-74/+77
| | | | | | where available. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599531 13f79535-47bb-0310-9956-ffa450edef68
* Remove useless spaces that are not in 2.4.xChristophe Jaillet2013-11-171-8/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542799 13f79535-47bb-0310-9956-ffa450edef68
* PR: 54852. Only use a dummy_connection for idle processesJim Jagielski2013-11-151-0/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542379 13f79535-47bb-0310-9956-ffa450edef68
* Pull out the "extended" pod functions used by event and workerJim Jagielski2012-11-141-0/+101
| | | | | | | | to core, since it will be used by Simple and Lean and likely other MPMs. Avoid duplication. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1409214 13f79535-47bb-0310-9956-ffa450edef68
* * server/mpm_unix.c (dummy_connection): Fix spello.Joe Orton2012-04-171-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1327080 13f79535-47bb-0310-9956-ffa450edef68
* * server/mpm_unix.c (dummy_connection): Use a TLS 1.0 close_notifyJoe Orton2012-04-171-21/+34
| | | | | | | | alert if the chosen listener is configured for https; not perfect but better than sending an HTTP request. Adjust comments. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1327036 13f79535-47bb-0310-9956-ffa450edef68
* * Partly revert r1303435 and rename pconf back to in_pconf to avoid shadowingRuediger Pluem2012-03-221-2/+2
| | | | | | | | | the global variable with the same name and create a bogus assignment. Pointed out by: Eric Covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1303827 13f79535-47bb-0310-9956-ffa450edef68
* * Fix changes in parameter names in function definitions done in r1303201Ruediger Pluem2012-03-211-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1303435 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1294936 (Jeff's revert) and fix NetWare / Win32 build.Guenter Knauf2012-03-211-9/+11
| | | | | | | | 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
* * server/mpm_unix.c (dummy_connection): Destroy temp pool and returnJoe Orton2012-03-131-0/+2
| | | | | | | on connect() failure. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1300171 13f79535-47bb-0310-9956-ffa450edef68
* Add lots of unique tags to error log messagesStefan Fritsch2011-12-031-22/+22
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
* Cleanup effort in prep for GA push:Jim Jagielski2011-09-231-5/+5
| | | | | | | | Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
* Add wrappers for malloc, calloc, realloc that check for out of memoryStefan Fritsch2011-09-191-1/+1
| | | | | | | | | | | | situations. Use them in most places where malloc, and friends are used. This results in clean error messages in an out of memory situation instead of segfaulting or silently malfunctioning. In some places, it just allows to remove some logging code. PR 51568, PR 51569, PR 51571. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
* Introduce ap_(get|set)_core_module_config() functions/macros and use themStefan Fritsch2011-06-061-1/+4
| | | | | | | | | | | | 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
* When shutting down with worker or event with active processes Jeff Trawick2011-05-171-4/+12
| | | | | | | | | | | | which had lost their scoreboard slot during a prior graceful restart, calls to ap_unregister_extra_mpm_process() were hidden if AP_DEBUG (maintainer mode) wasn't defined. This resulted in an uninitialized generation variable being passed through to the child_status hook. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103932 13f79535-47bb-0310-9956-ffa450edef68
* Use APR_STATUS_IS_... in some more cases.Stefan Fritsch2011-05-121-1/+1
| | | | | | | | While this is not strictly necessary everywhere, it makes it much easier to find the problematic cases. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1102124 13f79535-47bb-0310-9956-ffa450edef68
* Add child_status hook for tracking creation/termination of MPM childJeff Trawick2011-04-251-6/+13
| | | | | | | | | | | | | | 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
* Fix some MinGW build issues...Jeff Trawick2011-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | mpm_winnt.c: MinGW doesn't currently define the Windows STACK_SIZE_PARAM_IS_A_RESERVATION symbol mpm_unix.c: Bypass all this code on Windows (too much trouble to keep it out of Makefile) mpm_common.h: Skip over definitions of functions not available on Windows to keep references out of exports.c. PR: 49535 Submitted by: John Vandenberg <jayvdb gmail.com> Minor tweaks by: trawick Other commits for this PR: r1089950, r1089951, r1089954 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090614 13f79535-47bb-0310-9956-ffa450edef68
* Simplify the interface to ap_reclaim_child_processes() andJeff Trawick2011-03-301-4/+5
| | | | | | | | | | | | | 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
* the mpm-note-child-killed hook was just for use byJeff Trawick2011-03-301-2/+2
| | | | | | | | | 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
* PR50350: When no -k option is provided on the httpd command line, the serverEric Covener2010-11-291-4/+7
| | | | | | | | was starting without checking for an existing pidfile. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039989 13f79535-47bb-0310-9956-ffa450edef68
* remove more unused variablesStefan Fritsch2010-08-041-4/+0
| | | | | | | | | 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
* Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to takeStefan Fritsch2010-06-061-0/+2
| | | | | | | advantage of per-module loglevels git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
* OK, might as well finish this... Allow ServerTokens OffJim Jagielski2009-08-281-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808895 13f79535-47bb-0310-9956-ffa450edef68
* the mpm_get_child_pid hook is unnecessary, as was the per-MPM ↵Jeff Trawick2009-03-291-2/+5
| | | | | | | | | MPM_CHILD_PID() macro which it replaced axe this new hook, and use ap_get_scoreboard_process() instead git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759757 13f79535-47bb-0310-9956-ffa450edef68
* Do not presume we have a clean stackMladen Turk2009-03-291-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759647 13f79535-47bb-0310-9956-ffa450edef68
* remove BeOS OS supportJeff Trawick2009-03-261-10/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758891 13f79535-47bb-0310-9956-ffa450edef68
* refactor mpm_common.c into itself and mpm_unix.c for unix-specific quirksWilliam A. Rowe Jr2009-03-251-0/+925
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758367 13f79535-47bb-0310-9956-ffa450edef68