1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

4627 Commits

Author SHA1 Message Date
Jacob Champion
f50be63ee1 Revert new base64 function and tests
This should be trunk-only, not part of the backport branch.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpdunit@1799376 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 23:34:18 +00:00
Jacob Champion
6a1008ee10 util.c: add a strict Base64 decoding function
ap_pbase64decode_strict() adds to the functionality of
ap_pbase64decode() in two ways:

- the length of the decoded buffer is returned, allowing embedded NULLs
  to be retained by the caller
- the input string is strictly checked for Base64 validity, including
  correct zero-padding at the end of the string

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpdunit@1796208 13f79535-47bb-0310-9956-ffa450edef68
2017-05-25 21:18:42 +00:00
Luca Toscano
fafe95b905 Evaluate nested If/ElseIf/Else config sections
It has been reported multiple times that nested
If/ElseIf/Else sections are not evaluated but
silently ignored.

This patch adds a simple recursion to the ap_if_walk
logic in order to allow arbitrary nested configs.
The overhead seems negligible compared to the actual
version of the ap_if_walk, but more expert feedback
is surely needed since this code gets called for every
HTTP request.

Tests are going to be added to t/apache/if_sections.t



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1792589 13f79535-47bb-0310-9956-ffa450edef68
2017-04-25 09:06:26 +00:00
Nick Kew
38e269322b Introduce request taint-checking concept.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1792169 13f79535-47bb-0310-9956-ffa450edef68
2017-04-21 08:44:06 +00:00
Jacob Champion
58b127de3f PR61009: be as helpful as possible during -V operation
A configtest isn't useful if you're just trying to get compile settings.
Move the settings dump up to just after ap_read_config(), which has
already done the minimum necessary to figure out which MPM is in use.

Even if ap_read_config() failed, still print as many compile settings as
we can. The user will see the error log entry on stderr.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1791975 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 20:38:26 +00:00
William A. Rowe Jr
ff0f1b909a If the lingering close does not leave the socket in a disconnected state,
do not recycle the socket.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790978 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 14:09:00 +00:00
Stefan Eissing
354e89a57e On the trunk:
mpm_winnt: always invoke ap_lingering_close() at connection end.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790973 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 13:41:44 +00:00
Yann Ylavic
e68575506b core: Disallow multiple Listen on the same IP:port when listener buckets
are configured (ListenCoresBucketsRatio > 0), consistently with the single
bucket case (default), thus fixing the leak of the corresponding socket
descriptors on graceful restart.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1789220 13f79535-47bb-0310-9956-ffa450edef68
2017-03-28 21:05:41 +00:00
Yann Ylavic
98ce943cf6 Revert r1789061: it didn't any leak since duplicated listeners were already
created on pconf, hence cleaned up on restart. More investigations needed...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1789069 13f79535-47bb-0310-9956-ffa450edef68
2017-03-28 09:04:01 +00:00
Yann Ylavic
a1941d1347 core: Fix leak of duplicated listeners (socket descriptors) on restart
when ListenCoresBucketsRatio is configured (positive).

[Reverted by r1789069]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1789061 13f79535-47bb-0310-9956-ffa450edef68
2017-03-28 07:39:47 +00:00
Stefan Eissing
ad79dc4101 On the trunk:
core: avoid socket timeout settings etc. on slave connections.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1787606 13f79535-47bb-0310-9956-ffa450edef68
2017-03-19 10:33:43 +00:00
Eric Covener
dcaae91ade print r->uri during failure
in a subrequest, r->the_request will be the one from r->main,
and it's not what we're checking above.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1787229 13f79535-47bb-0310-9956-ffa450edef68
2017-03-16 18:41:59 +00:00
Mike Rumph
cbb95aab0b Fix some spelling errors in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786384 13f79535-47bb-0310-9956-ffa450edef68
2017-03-10 16:42:26 +00:00
Joe Orton
f843f6fd07 * server/config.c, include/http_config.h (ap_build_cont_config,
ap_soak_end_container): Constify directive arguments - existing
  callers pass string literals.

* server/core.c (start_cond_section): Remove casts needed for above.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786120 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 09:48:24 +00:00
Joe Orton
d20f527062 * server/core.c (start_cond_section): Comment & variable name fixes,
no functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786119 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 09:39:46 +00:00
Joe Orton
ec40c3c197 Add <IfDirective> and <IfSection>:
* server/core.c
  (test_ifdirective_section, test_ifsection_section): New callbacks.
  (core_cmds): Define new directives.

* include/http_config.h, server/config.c (ap_exists_directive):
  New function.

* include/ap_mmn.h: Bump MMN minor for above.

* docs/manual/mod/core.xml: Add docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786110 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 08:39:56 +00:00
Joe Orton
60301274df Remove duplicate implementations of conditional section function. No
functional change.

* server/core.c (start_cond_section): Factor out from start_if*.
  Adjust to use apr_strmemdup.
  (test_ifmod_section, test_iffile_section, test_ifdefine_section):
  Move container-specific tests into callbacks from start_if*.
  (core_cmds): Adjust <IfFile, <IfDefine, <IfModule to use
  start_cond_section with callbacks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1785943 13f79535-47bb-0310-9956-ffa450edef68
2017-03-08 10:09:15 +00:00
Yann Ylavic
841802066c mpm_event: no mutex needed at ptrans' allocator level.
(reverts r1783761 and r1783755 partially, style changes preserved)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783896 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:33:30 +00:00
Yann Ylavic
afea2aad65 mpm_worker: no mutex needed at ptrans' allocator level.
(reverts r1783808)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783895 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:24:14 +00:00
Yann Ylavic
03545993ce mpm_motorz: no mutex needed at ptrans' allocator level.
(reverts r1783755 partially)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783894 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:21:44 +00:00
Yann Ylavic
f46d03312e MPMs unix: Place signals handlers and helpers out of DSOs to avoid
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
2017-02-21 09:07:42 +00:00
Yann Ylavic
6101554faf mpm_motorz: follow up to r1783755.
Use an allocator and mutex for ptrans' to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783810 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 22:50:56 +00:00
Yann Ylavic
5b8c9f7a26 mpm_worker: follow up to r1783755.
Use a mutex for ptrans' allocator to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783808 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 22:49:05 +00:00
Yann Ylavic
45b1409887 mpm_motorz: follow up to r1783772, with the real changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783782 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 16:55:50 +00:00
Yann Ylavic
f6cc395317 winnt/service: each log message should use its own APLOGNO.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783770 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 14:15:40 +00:00
Yann Ylavic
16dc9c205a Follow up to r1783755: update APLOGNO.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783761 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:56:32 +00:00
Yann Ylavic
6699f4e509 Revert r1783759: really more things than intended :p
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783760 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:53:16 +00:00
Yann Ylavic
37ebaff84d Follow up to r1783755: update APLOGNO.
[Reverted by r1783760]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783759 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:50:49 +00:00
Yann Ylavic
db8951e929 mpm_event: use a mutex for ptrans' allocator to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783755 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:38:03 +00:00
Yann Ylavic
67e267e0e2 default_handler: cleanup outputed brigade before leaving.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783041 13f79535-47bb-0310-9956-ffa450edef68
2017-02-14 22:32:05 +00:00
Yann Ylavic
065e8248bd util_filter: better ap_pass_brigade() vs empty brigades.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782986 13f79535-47bb-0310-9956-ffa450edef68
2017-02-14 16:43:25 +00:00
Eric Covener
152588ab23 80 chars
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780282 13f79535-47bb-0310-9956-ffa450edef68
2017-01-25 22:29:26 +00:00
Eric Covener
f05f006b85 PR60647: ACC per connection not available w/ event MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780280 13f79535-47bb-0310-9956-ffa450edef68
2017-01-25 22:23:43 +00:00
Eric Covener
fe3c9b7a0f Fix %{DOCUMENT_URI} in SSI w/ default parser
*) core: %{DOCUMENT_URI} used in nested SSI expressions should point to the
     URI originally requsted by the user, not the nested documents URI. This
     restores the behavior of this variable to match the "legacy" SSI parser.
     PR60624. 

Submitted By [Hank Ibell <hwibell gmail.com>]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780095 13f79535-47bb-0310-9956-ffa450edef68
2017-01-24 17:09:47 +00:00
Yann Ylavic
69c942269d event: follow up to r1762701.
Keep QUEUE_APPEND()+pollset_add() or QUEUE_REMOVE()+pollset_remove() atomic.

Otherwise when a worker adds an entry in some queue (e.g. KA, lingering), it
might race with the listener in the time between the mutex is released and the
pollset is updated; meanwhile the listener might process the queue and find an
entry no yet in its pollset.

For the lingering queue, the entry could then have been used after its pool
destroyed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1779354 13f79535-47bb-0310-9956-ffa450edef68
2017-01-18 16:08:51 +00:00
Eric Covener
b76545b789 avoid SO_REUSEPORT w/o ListenCoresBucketsRatio
Can lead to unintended/confusing sharing between 
multiple servers started by the same ID.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777923 13f79535-47bb-0310-9956-ffa450edef68
2017-01-09 00:47:16 +00:00
Christophe Jaillet
fb209dbba2 Fix some tiny style issues (missing space)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777594 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 11:58:23 +00:00
Christophe Jaillet
9adefaa2cf 'repl' is already allocated in the request pool by 'construct_host_header()' the line just before.
So this is safe to use the 'apr_table_setn' variant in order to save a few bytes of memory.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777593 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 11:52:15 +00:00
Eric Covener
b2fb7e185c old IBM EBCDIC fix that never got shared.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777354 13f79535-47bb-0310-9956-ffa450edef68
2017-01-04 18:04:26 +00:00
Eric Covener
b3531c422d PR59938: add %{REMOTE_PORT} to the expression parser
Submitted By: Hank Ibell <hwibell gmail.com>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776459 13f79535-47bb-0310-9956-ffa450edef68
2016-12-29 18:31:13 +00:00
Eric Covener
4bc922d0c3 remove initial isascii check entirely
We are already checking an even narrower set of characters
just below.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775664 13f79535-47bb-0310-9956-ffa450edef68
2016-12-22 14:22:22 +00:00
Eric Covener
b9822a70a1 fix crash in util_fcgi.c
*) mod_proxy_fcgi, mod_fcgid: Fix crashes in ap_fcgi_encoded_env_len() when
    modules add empty environment variables to the request. PR60275.
    [<alex2grad AT gmail.com>]

Submitted By: <alex2grad AT gmail.com>]
Committed By: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775487 13f79535-47bb-0310-9956-ffa450edef68
2016-12-21 16:19:26 +00:00
Eric Covener
1db2f476c5 Fix strict Host: header checking on EBCDIC
on zOS, isascii() really means 7 bit ascii, but our strings
are in ebcdic for 99.95% of the lifetime of the server.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775199 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 03:38:59 +00:00
Eric Covener
14ade933dd assign a logno
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775196 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 01:32:44 +00:00
Yann Ylavic
af22ceed1c event: close a race condition where we might re-enable listeners while they
are already or about to be closed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774541 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:55:12 +00:00
Yann Ylavic
f7ff940a29 event: follow up to r1762718.
On graceful shutdown/restart, kill kept-alive connections before poll()ing
again, avoiding to wait for their "normal" timers (before being woken up)
when they remain the last handled connections.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774538 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:17:26 +00:00
Yann Ylavic
540e19cfb6 Revert r1774525, will commit a better way to handle this.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774535 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:10:12 +00:00
Jim Jagielski
466ced7d02 kill the keepalive conns as early as possible during graceful
process exit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774525 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 21:32:50 +00:00
William A. Rowe Jr
cdc1d3a938 With the changes of api from pcre 8.x to 10.x, do not presume that the internal
ovector will be created to accept greater than nmatch elements for processing.
Allocate enough elts in all circumstances for pcre2api.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773882 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 21:57:06 +00:00
William A. Rowe Jr
12cfcf08ff Replace PCRE with PCRE2 where it is available.
This patch removes the needless assignment of re_erroffset in the conf pool
by the worker threads; such mistakes break the shared copy-on-write pages of
memory that should have remained common between all httpd worker processes.

Two de-optimizations are inherent in this patch, the former ovector-on-stack
opportunity is lost unless implemented as a new general context. Safer that
we either create a new general context using pool allocation, or recycle a
per pool or per thread match_data buffer of some arbitrary 10 elts or so.

Submitted by: wrowe, Petr Pisar <ppisar@redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773454 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 19:06:06 +00:00