1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-18 11:41:02 +03:00
Commit Graph

4226 Commits

Author SHA1 Message Date
Eric Covener
e0b79f44a9 Configuration files with long lines and continuation characters
are not read properly. PR 55910. 

Submitted By: Manuel Mausz <manuel-as mausz.at>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1648394 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 17:27:46 +00:00
Eric Covener
829e98c57d looks like debug left in r1642154
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647125 13f79535-47bb-0310-9956-ffa450edef68
2014-12-21 11:47:26 +00:00
Yann Ylavic
3f0d0a66bd util_expr: sync bison generated source files with according
to changes on server/util_expr_parse.y from r1642154.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643929 13f79535-47bb-0310-9956-ffa450edef68
2014-12-08 21:20:50 +00:00
Yann Ylavic
8b77d7e81f Revert r1643900.
May someone with a bison version closer to the original one make this change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643901 13f79535-47bb-0310-9956-ffa450edef68
2014-12-08 20:06:24 +00:00
Yann Ylavic
3415691b45 util_expr: sync bison generated source files with
server/util_expr_parse.y from r1642154.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643900 13f79535-47bb-0310-9956-ffa450edef68
2014-12-08 19:46:53 +00:00
Yann Ylavic
bfdb0ece3e * core: Fix -D[efined] or <Define>[d] variables lifetime accross restarts.
PR 57328.

Submitted-by: Armin Abfalterer <a.abfalterer gmail.com>
Reviewed/Committed-by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643825 13f79535-47bb-0310-9956-ffa450edef68
2014-12-08 14:29:13 +00:00
Yann Ylavic
e6d70ea7bc mpm_event(opt): zero is immutable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643284 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 14:00:37 +00:00
Yann Ylavic
62da621f82 mpm_worker: replace apr_atomic_cas32(+1) loop with the more performant
apr_atomic_inc32().
Also declare fd_queue_info_t's idlers member as volatile since it is
used outside atomic functions (or it could be optimized out by the
compiler).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643282 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 13:54:30 +00:00
Yann Ylavic
abb1b803d6 mpm_event(opt): avoid casts/comparisons from unsigned to signed (atomics).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643279 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 13:41:38 +00:00
Ruediger Pluem
ddc48bf250 * Correctly indent
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643220 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 10:02:57 +00:00
Yann Ylavic
8fb0b6f980 mpm_{prefork,worker}: follow up to r1635521.
Don't crash when there is no accept mutex (one listener => apr_proc_mutex_name(NULL)).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643179 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 07:57:57 +00:00
Daniel Gruno
f1d7ed9cde ap_expr: Add filemod function for checking file modification times.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643145 13f79535-47bb-0310-9956-ffa450edef68
2014-12-05 00:46:33 +00:00
Jan Kaluža
529b4906a6 * ap_expr: Fix replace() func when length of "from" != length of "to".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643094 13f79535-47bb-0310-9956-ffa450edef68
2014-12-03 11:10:50 +00:00
Yann Ylavic
7791f925d3 mpm_event: follow up to r1639614 (trunk) and r1642858 (2.4.x).
Notify suspend in any case when starting lingering close (blocking),
and outside the lingering queue's critical section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642868 13f79535-47bb-0310-9956-ffa450edef68
2014-12-02 13:41:14 +00:00
Jeff Trawick
d49e6f0ad9 core: Add CGIPassAuth directive to control whether HTTP authorization
headers are passed to scripts as CGI variables.

PR: 56855


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642847 13f79535-47bb-0310-9956-ffa450edef68
2014-12-02 12:20:21 +00:00
Jan Kaluža
bd41584fcb * ap_exr: Add replace(string, from, to) function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642154 13f79535-47bb-0310-9956-ffa450edef68
2014-11-27 13:46:11 +00:00
Yann Ylavic
4669bc745b mpm_event(opt), mpm_worker, mpm_prefork: follow up to r1635521, r1640161.
Retain num_buckets and max_buckets accross restarts so that we can determine
whether new buckets were allocated and set their idle_spawn_rate at the same
level as the existing ones (max).

Also, adjust ap_daemons_limit and ap_daemons_to_start lower bounds at mpm_run()
time, once num_buckets is available for the current generation (previously done
at check_config time, hence before num_buckets is computed, and then with the
previous generation's value).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640763 13f79535-47bb-0310-9956-ffa450edef68
2014-11-20 16:26:04 +00:00
Yann Ylavic
fe1189c22f mpm_prefork: follow up to r1635521.
Avoid oddity on bucket_make_child_record overflow.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640184 13f79535-47bb-0310-9956-ffa450edef68
2014-11-17 16:31:06 +00:00
Yann Ylavic
9d670bcfdf mpm_event(opt), mpm_worker: follow up to r1635521.
Allocate retained idle_spawn_rate vector on the process pool.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640161 13f79535-47bb-0310-9956-ffa450edef68
2014-11-17 13:59:36 +00:00
Yann Ylavic
c5d85f6439 mpm_worker, mpm_prefork: follow up to r1635521.
Use one dedicated accept mutex per listeners bucket.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640145 13f79535-47bb-0310-9956-ffa450edef68
2014-11-17 11:45:29 +00:00
Yann Ylavic
f1cb9b287a event, eventopt: follow up to r1638879 and r1639960.
Clear the pool in ap_push_pool() before recycling.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640031 13f79535-47bb-0310-9956-ffa450edef68
2014-11-16 21:32:48 +00:00
Christophe Jaillet
ebbed36037 avoid dereferencing a recently apr_pool_clear()'ed event_conn_state_t *cs
in several paths where ptrans is being recycled at the end of a request.

Same as r1638879 which was for the event MPM.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1639960 13f79535-47bb-0310-9956-ffa450edef68
2014-11-16 05:55:14 +00:00
Eric Covener
b38d5d5979 don't call notify_suspend() in a worker thread after
start_lingering_close_common may have put the socket back
into the pollset. 

If it becomes readable too quickly, cs can be
free'ed or accessed concurrently.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1639614 13f79535-47bb-0310-9956-ffa450edef68
2014-11-14 12:04:46 +00:00
Eric Covener
c2d42b1214 revert r1638691, more comprehensive followup planned shortly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1639564 13f79535-47bb-0310-9956-ffa450edef68
2014-11-14 02:24:40 +00:00
Eric Covener
051a1291c9 avoid dereferencing a recently apr_pool_clear()'ed event_conn_state_t *cs
in several paths where ptrans is being recycled at the end of a request.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638879 13f79535-47bb-0310-9956-ffa450edef68
2014-11-12 17:32:24 +00:00
Eric Covener
48611f3ed2 Fix a bug in r1604350 that can lead to crashes in the event MPM under load.
if start_lingering_close_blocking() returns 0, notify_suspend() will 
write a 1 into some potentially recently free'd memory from 
ptrans (cs->suspended).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638691 13f79535-47bb-0310-9956-ffa450edef68
2014-11-12 02:29:38 +00:00
Jan Kaluža
302d4e908c * server/scoreboard.c: Check for child_num < 0 also in ap_update_child_status
and ap_update_child_status_from_conn. PR 56767.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638073 13f79535-47bb-0310-9956-ffa450edef68
2014-11-11 12:06:53 +00:00
Ruediger Pluem
601d28bbb9 * Add missing include for ap_pglobal
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635859 13f79535-47bb-0310-9956-ffa450edef68
2014-10-31 20:41:29 +00:00
Eric Covener
791f84b06d Support custom ErrorDocuments for HTTP 501 and 414 status codes.
PR 57167 [Edward Lu <Chaosed0 gmail.com>]

Submitted By: Edward Lu <Chaosed0 gmail.com>
Committed By: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635762 13f79535-47bb-0310-9956-ffa450edef68
2014-10-31 13:17:38 +00:00
Yann Ylavic
61d5a3c1ca MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531
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
2014-10-30 15:24:58 +00:00
Jan Kaluža
7dd5dc8bf6 core: Do not match files when using DirectoryMatch. PR41867.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635428 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 08:34:12 +00:00
Christophe Jaillet
268e463e27 tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633528 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:22:09 +00:00
Christophe Jaillet
a0e231df26 tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633527 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:21:22 +00:00
Christophe Jaillet
5d8dd1fc91 tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633525 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:12:51 +00:00
Christophe Jaillet
a3ca028f70 Style ('{' on same line as function definition)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1631021 13f79535-47bb-0310-9956-ffa450edef68
2014-10-11 05:47:02 +00:00
Yann Ylavic
7ecfc45fdf core: follow up to r1629909: fix min_spare_threads lower bound and check wrt num_buckets.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629990 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 21:59:02 +00:00
Yann Ylavic
1d1f7d8944 core: follow up to r1629925: new log tag
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629927 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 16:59:44 +00:00
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
Yann Ylavic
90d30c63e0 mpms: enforce assertion that unreachable code is not reached.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629918 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 15:46:05 +00:00
Yann Ylavic
7d64b627e5 core: follow up to r1629909: ap_daemons_to_start can't be lower than 1 (not 0) for prefork either.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629916 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 15:35:56 +00:00
Yann Ylavic
a527db4331 core: Use process scoreboard to store each child's listener bucket,
and silently adjust the configured number of processes/threads to
be above the computed number of listener buckets (depending on the
CPU cores).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629909 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 15:16:02 +00:00
Jan Kaluža
71af35749e event: Fix worker-listener deadlock in graceful restart caused by get_worker()
allocating new worker after ap_queue_info_term(), but not setting the
have_idle_worker variable. PR 56960.

Submitted By: Zin UDA
Committed By: jkaluza


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629577 13f79535-47bb-0310-9956-ffa450edef68
2014-10-06 06:07:47 +00:00
Jan Kaluža
0b98be8f60 event: have_idle_worker must not be cleared in every listener_thread iteration.
Fixes bug when workers were not stopped after graceful restart (introduced in
r1605328).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629576 13f79535-47bb-0310-9956-ffa450edef68
2014-10-06 05:57:02 +00:00
Christophe Jaillet
40cc356ac3 Content-Length header should always be interpreted as a decimal.
Leading 0  could be erroneously considered as an octal value. PR 56598.
[Chris Card <ctcard hotmail com>]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626086 13f79535-47bb-0310-9956-ffa450edef68
2014-09-18 21:01:40 +00:00
Jim Jagielski
c8aadf8659 prepend 0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1625953 13f79535-47bb-0310-9956-ffa450edef68
2014-09-18 12:14:05 +00:00
Jim Jagielski
c157a02ad2 mod_status should honor remote_ip as documented
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624349 13f79535-47bb-0310-9956-ffa450edef68
2014-09-11 17:53:48 +00:00
Christophe Jaillet
2785b009e9 Silent some cppcheck warnings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621806 13f79535-47bb-0310-9956-ffa450edef68
2014-09-01 14:40:01 +00:00
Christophe Jaillet
f1176161be Fix sscanf format spotted by cppcheck.
Improve alignment.
Untested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621419 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 06:51:11 +00:00
Christophe Jaillet
3bd80dadb5 Fix printf format spotted by cppcheck.
Untested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621417 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 06:45:09 +00:00
Jan Kaluža
3bd97552e9 worker MPM: Fix null-dereference crash when using -DFOREGROUND with worker MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620569 13f79535-47bb-0310-9956-ffa450edef68
2014-08-26 11:05:37 +00:00