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

242 Commits

Author SHA1 Message Date
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
Jeff Trawick
00b4adb3b1 revert accidental commit 1200129
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200140 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:19:21 +00:00
Jeff Trawick
e4f5c7198e clean up unused ap_my_generation variable
(presence is odd, since this variable as an API was supposedly removed
  long ago, and a similarly named static variable was removed in r1078286)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200129 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:10:42 +00:00
Stefan Fritsch
7d0348cd78 If a child is created just before graceful restart and then exits because
of a missing lock file, don't shutdown the whole server.

PR: 39311
Submitted by: Shawn Michael <smichael rightnow com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180742 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 23:10:12 +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
Stefan Fritsch
01ed21af9d Add wrappers for malloc, calloc, realloc that check for out of memory
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
2011-09-19 16:25:42 +00:00
Stefan Fritsch
d4e7fad995 Install signal handlers for crashes before detaching. Previously, there
was a time span where crashes would be neither visible on the console nor
logged in the error log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151234 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 20:37:49 +00:00
Stefan Fritsch
344dbd4e82 Reduce period during startup and restart where a successive signal may be lost
PR: 43696
Submitted by: Arun Bhalla <arun shme net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151233 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 20:36:56 +00:00
Stefan Fritsch
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
Stefan Fritsch
5f2cf595f0 Fix search'n'replace error: Actually warn if MaxClients is used
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137757 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 19:47:23 +00:00
Stefan Fritsch
6d8de2ff42 Rename MaxClients to MaxRequestWorkers which describes more accurately what
it does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137744 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 19:00:52 +00:00
Jeff Trawick
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
Jeff Trawick
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
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
Jeff Trawick
7be2d26631 consolidate logic to remove the pidfile in a new API,
ap_remove_pid(), related to existing ap_log_pid() and
ap_read_pid()

presumably this is useful to third-party MPMs as well


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086224 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 13:35:08 +00:00
Joe Orton
239188a96b * server/mpm/prefork/prefork.c (set_signals): Ignore SIGXFSZ; have a
write() beyond 2GB fail with E2BIG rather than killing the process
  in the now hopefully rare case of non-LFS file usage on LFS systems.

* server/mpm/worker/worker.c (set_signals): Likewise.
* server/mpm/event/event.c (set_signals): Likewise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084000 13f79535-47bb-0310-9956-ffa450edef68
2011-03-21 22:36:45 +00:00
Jeff Trawick
4487fa925a worker, event, prefork: Correct several issues when built as
DSOs; most notably, the scoreboard was reinitialized during graceful
restart, such that processes of the previous generation were not
observable.

Other noticeable ones:
* the generation number did not increment properly
* worker's check-config hook didn't detect startup properly,
  so messages about inconsistent directives could have been sent
  to the wrong place

max_daemons_limit wasn't tracked across restart, but as the scoreboard
was always cleared this was a non-issue.

Reinitialization of idle_spawn_rate, hold_off_on_exponential_spawning,
and maxclients-message-reported may or may not have been features,
but the big picture is that the behaviour shouldn't have differed.

These changes should have been part of r758185.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078286 13f79535-47bb-0310-9956-ffa450edef68
2011-03-05 13:36:09 +00:00
Jeff Trawick
21a628f138 zap needless reinitialization of is_graceful on the 2nd
call of the open-logs hook


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078285 13f79535-47bb-0310-9956-ffa450edef68
2011-03-05 13:09:12 +00:00
Jeff Trawick
3b75c26516 sanity check use of volatile in prefork, worker, and event
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078170 13f79535-47bb-0310-9956-ffa450edef68
2011-03-04 22:12:21 +00:00
Jeff Trawick
b7a8638aca worker: child_main() never returns, so remove some dead code after
one of the calls


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1076614 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 13:16:14 +00:00
Stefan Fritsch
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
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
Rainer Jung
6c696580ea Silence compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951866 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 14:04:06 +00:00
Jeff Trawick
007951df35 fix compile failure in r940981
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@941454 13f79535-47bb-0310-9956-ffa450edef68
2010-05-05 20:01:22 +00:00
William A. Rowe Jr
01d300298f Catch up with ap_[proc|global]_mutex_create api change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940981 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 17:40:43 +00:00
Eric Covener
555372fbfc all signs indicate that status value is always -1 on error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@922405 13f79535-47bb-0310-9956-ffa450edef68
2010-03-12 19:55:35 +00:00
Eric Covener
c81cbf5592 reduce the warning level in the bindprocessor() call used to make sure child
processes aren't bound to the CPU the parent is running on.

In recent levels of AIX, the parent isn't implicitly bound to a CPU 
(so the children don't inherit it), and when the AIX WPAR feature is enabled 
this call can return EPERM, even though the child process is already unbound.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@922392 13f79535-47bb-0310-9956-ffa450edef68
2010-03-12 18:49:26 +00:00
Daniel Earl Poirier
0c96068dc4 Log command line on startup, so there's a record of command line
arguments like -f.  Suggested by Shaya Potter.  [Dan Poirier]
PR: 48752


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910684 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 20:50:10 +00:00
Jeff Trawick
aecc198b93 change the preprocessor define ap_accept_mutex_type to upper case
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907723 13f79535-47bb-0310-9956-ffa450edef68
2010-02-08 16:59:45 +00:00
Daniel Earl Poirier
16b9ccd6ec worker: don't report server has reached MaxClients until it does.
Add warning when within MinSpareThreads.

PR: 46996


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906535 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 16:00:51 +00:00
Takashi Sato
b4e16bedea string constness
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894361 13f79535-47bb-0310-9956-ffa450edef68
2009-12-29 11:51:40 +00:00
Jeff Trawick
2e9668a33d Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive.  Add APIs to
simplify setup and user customization of APR proc and global mutexes.  
(See util_mutex.h.)  Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.

Some existing modules, such as mod_ldap and mod_auth_digest gain 
configurability for their mutexes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +00:00
Jim Jagielski
83532ab628 Enhance ap_hook_monitor to pass along a server_rec (in
general the ap_server_conf) and tuck away some storage
in there which may be useful as an opaque data pointer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@818825 13f79535-47bb-0310-9956-ffa450edef68
2009-09-25 11:59:30 +00:00
Greg Ames
201d3d584f * prevent a fork bomb if the accept mutex is clobbered by exiting with
APEXIT_CHILDSICK if the worker process hasn't served any requests
* move the accept mutex error leg into its own function to take advantage of
  common code and to keep rarely executed instructions out of the mainline
  instruction cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815915 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 18:07:09 +00:00
Ruediger Pluem
3fadc493c9 * Do better checking of pollset operations in various places to avoid segfaults.
PR: 46467
Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@804764 13f79535-47bb-0310-9956-ffa450edef68
2009-08-16 20:29:47 +00:00
Greg Ames
f9554d542d no longer amusing.
I'll still pay off if somebody does it legitimately, but I haven't been
to Apachecon in ages so we'll have to work out a different delivery
mechanism.  With the stability of the 2.0.x and 2.2.x releases and
Moore's Law in effect for the last decade, it might be possible...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@765305 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 18:52:39 +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
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
35e3599b25 the mpm_get_child_pid hook is unnecessary, as was the per-MPM 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
2009-03-29 19:30:17 +00:00
Jeff Trawick
a1908585a8 Core can specify a platform-specific rewrite args hook. Use that on Unix.
Windows continues to specify this in the MPM, at least until someone
can separate out the MPM-specific bits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759699 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 14:41:02 +00:00
Mladen Turk
bf086f6dcc Register rewrite_args hook.
Now, dunno if that was intended, but at least allow to start the httpd

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759648 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 08:22:28 +00:00
Jeff Trawick
901744828a prefork, worker, event:
restore expected accept mutex mechanism and allocator limit support
  (the related AP_MPM_WANT_foo defines no longer exist)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758680 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 15:24:11 +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
de5f7aa944 prefork, worker, and event MPMs: use retained-data API to maintain
information across reconfigs, to allow these MPMs to work as DSOs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758185 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 09:23:23 +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
Paul Querna
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
Nick Kew
368d9bb335 Further unixd hacks to remove duplication between old-unixd and mod_unixd,
and get it working with old MPMS[1] + mod_unixd.  It's still an uneasy
split, as some modules (mod_cgid, suexec)[2] also use unixd.
More thinking+hacking due.

[1] Should be prefork/worker/event, but only worker is tested.
[2] cgid is OK, suexec is untested.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711146 13f79535-47bb-0310-9956-ffa450edef68
2008-11-04 00:44:56 +00:00