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

594 Commits

Author SHA1 Message Date
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
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
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
Eric Covener
a3992a3411 add an <IfFile> config section like <IfDefine>
It allows a non httpd config file to be used as a marker directly in
httpd.conf without hiding logic in a script in front of apachectl
to do test -f and pass extra -D's.

This is something we've had in IBM's httpd distro for a little bit and
hadn't remembered to share. I've seen some questions/config files come
up in a few places lately that would benefit from this as an option.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769718 13f79535-47bb-0310-9956-ffa450edef68
2016-11-15 03:50:42 +00:00
William A. Rowe Jr
84ce5d25db Dropped the never-released ap_has_cntrls() as it had very limited
and inefficient application at that, added ap_scan_vchar_obstext()
to accomplish a similar purpose.

Dropped HttpProtocolOptions StrictURL option, this will be better
handled in the future with a specific directive and perhaps multiple
levels of scrutiny, use ap_scan_vchar_obstext() to simply ensure there
are no control characters or whitespace within the URI.

Changed the scanning of the response header table by check_headers()
to follow the same rulesets as reading request headers. Disallow any
CTL character within a response header value, and any CTL or whitespace
in response header field name, even in strict mode.

Apply HttpProtocolOptions Strict to chunk header parsing, invalid
whitespace is invalid, line termination must follow CRLF convention.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764961 13f79535-47bb-0310-9956-ffa450edef68
2016-10-14 20:48:43 +00:00
Jacob Champion
f533af4b28 mpm_winnt: remove 'data' AcceptFilter in favor of 'connect'
The 'data' AcceptFilter optimization instructs Windows to wait until
data is received on a connection before completing the AcceptEx
operation. Unfortunately, it seems this isn't performed atomically --
AcceptEx "partially" accepts the incoming connection during the wait for
data, leaving all other incoming connections in the accept queue. This
opens the server to a denial of service.

Since the fix for this requires a substantial rearchitecture (likely
involving multiple outstanding calls to AcceptEx), disable the 'data'
filter for now and replace it with 'connect', which uses the AcceptEx
interface but does not wait for data.

Users running prior releases of httpd on Windows should explicitly move
to a 'connect' AcceptFilter in their configurations if they are
currently using the default 'data' filter.

Many thanks to mludha, Arthur Ramsey, Paul Spangler, and many others for
their assistance in tracking down and diagnosing this issue.

PR: 59970

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758307 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 23:56:16 +00:00
William A. Rowe Jr
f54c03b7ee Folding StrictWhitespace into the Strict ruleset of RFC7230, per dev@ poll.
This choice is unanimous, although StrictURI (a different RFC) still hasn't
found absolute concensus.

An ap_mmn bump will follow (major, this removes a struct elt)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758226 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 13:47:27 +00:00
William A. Rowe Jr
6cae6f2487 Rename LenientWhitespace to UnsafeWhitespace and change StrictWhitespace
to the default behavior, after discussion with fielding et al about the
purpose of section 3.5. Update the documentation to clarify this.

This patch removes whitespace considerations from the Strict|Unsafe toggle
and consolidates them all in the StrictWhitespace|UnsafeWhitespace toggle.

Added a bunch of logic comments to read_request_line parsing.

Dropped the badwhitespace list for an all-or-nothing toggle in rrl.

Leading space before the method is optimized to be evaluated only once.

Toggled the request from HTTP/0.9 to HTTP/1.0 for more BAD_REQUEST cases.

Moved s/[\n\v\f\r]/ / cleanup logic earlier in the cycle, to operate on
each individual line read, and catch bad whitespace errors earlier.
This changes the obs-fold to more efficiently condense whitespace and
forces concatinatination with a single SP, always. Overrides are not
necessary since obs-fold is clearly deprecated.






git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757589 13f79535-47bb-0310-9956-ffa450edef68
2016-08-25 01:46:20 +00:00
William A. Rowe Jr
b9a6a0ee7b Introduce StrictURI|UnsafeURI for RFC3986 enforcement
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756959 13f79535-47bb-0310-9956-ffa450edef68
2016-08-19 19:48:58 +00:00
William A. Rowe Jr
8d77efe21e Perform correct, strict parsing of the request line, handling the
http protocol tag, url and method appropriately, and attempting 
to extract values even in the presence of unusual whitespace in
keeping with section 3.5, prior to responding with whatever
error reply is needed. Conforms to RFC7230 in all respects,
the section 3.5 optional behavior can be disabled by the user
with a new HttpProtocolOptions StrictWhitespace flag. In all
cases, the_request is regenerated from the parsed components
with exactly two space characters.

Shift sf's 'strict' method check from the Strict behavior because
it violates forward proxy logic, adding a new RegisteredMethods
flag, as it will certainly be useful to some.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756729 13f79535-47bb-0310-9956-ffa450edef68
2016-08-18 07:15:06 +00:00
William A. Rowe Jr
b0784b0f7b Renaming this directive to HttpProtocolOptions after discussion on dev@
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756649 13f79535-47bb-0310-9956-ffa450edef68
2016-08-17 16:24:23 +00:00
William A. Rowe Jr
fc367d65ee Rename the previously undocumented HTTPProtocol directive
to EnforceHTTPProtocol, and invert the default behavior
to strictly observe RFC 7230 unless otherwise configured.
And Document This.

The relaxation option is renamed 'Unsafe'. 'Strict' is no
longer case sensitive. 'min=0.9|1.0' is now the verbose
'Allow0.9' or 'Require1.0' case-insenstive grammer. The
exclusivity tests have been modified to detect conflicts.

The 'strict,log' option failed to enforce strict conformance,
and has been removed. Unsafe, informational logging is possible
in any loadable module, after the request data is unsafely
accepted.

This triggers a group of failures in t/apache/headers.t as
expected since those patterns violated RFC 7230 section 3.2.4.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756540 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 18:11:14 +00:00
Eric Covener
2d0b6b5598 Add -DDUMP_INCLUDES configtest option to show the tree
of Included configuration files.  


Example:

    Included configuration files:
      (*) .../conf/httpd.conf
        (517) .../conf/extra/proxy-html.conf
          (91) /dev/null



Submitted By: Jacob Champion <champion.pxi gmail.com>
Committed By: covener





git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747808 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 22:44:39 +00:00
William A. Rowe Jr
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
Christophe Jaillet
25faf5bb1d Remove out-dated comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1744655 13f79535-47bb-0310-9956-ffa450edef68
2016-05-20 04:18:48 +00:00
William A. Rowe Jr
195a2defa7 We need another guard, this may resolve a crash in the rather odd faux-server
implementation in mod_perl test suite which calls access checking too early.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742135 13f79535-47bb-0310-9956-ffa450edef68
2016-05-03 16:02:43 +00:00
William A. Rowe Jr
160eef0a0c Ensure http2 follows http in the meaning of
status WRITE (meaning 'in the request processing
  phase' even if still consuming the request body,
  not literally in a 'now writing' state).

  Ensure a number of MPMs and the h2 connection io
  no longer clobber the request status line during
  state-only changes.  While at it, clean up some
  very ugly formatting and unnecessary decoration,
  and avoid the wordy _from_conn() flavor when we
  are not passing a connection_rec.

  Ensure the useragent_ip is only used in the case
  where it has been initialized, fall back on the
  connection's remote_ip if the status is accidently
  updated from an uninitialized request_rec.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1741310 13f79535-47bb-0310-9956-ffa450edef68
2016-04-27 18:41:49 +00:00
Yann Ylavic
f9ad2754f7 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740928 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 00:04:57 +00:00
Yann Ylavic
5fd7a9a722 core: '!x == 0' => 'x != 0' to avoid a compiler warning (suggesting parens).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737103 13f79535-47bb-0310-9956-ffa450edef68
2016-03-30 11:30:50 +00:00
Eric Covener
2da4063a6f fix order of lowercase/compare for r->handler
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735786 13f79535-47bb-0310-9956-ffa450edef68
2016-03-19 16:48:19 +00:00
Jeff Trawick
9b6702a85c Add CGIVar directive for configuring REQUEST_URI behavior
The goal is to use this one directive to handle any configurable
CGI variable behavior; only one CGI variable is supported initially.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734947 13f79535-47bb-0310-9956-ffa450edef68
2016-03-14 15:42:45 +00:00
Jeff Trawick
faa748ed66 Fix doc string for QualifyRedirectURL, and related typo in manual
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734835 13f79535-47bb-0310-9956-ffa450edef68
2016-03-13 18:08:48 +00:00
Graham Leggett
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
Christophe Jaillet
a429d04f29 Fix a bug in <UnDefine ...> directive processing. When used, the last <Define...>'ed variable was also withdrawn.
PR 59019

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1732716 13f79535-47bb-0310-9956-ffa450edef68
2016-02-28 10:55:04 +00:00
Christophe Jaillet
824640a6f3 Save a few bytes in conf pool when parsing 'DocumentRoot' directive on some OS.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1732353 13f79535-47bb-0310-9956-ffa450edef68
2016-02-25 19:49:21 +00:00
Christophe Jaillet
f115c49281 Save a few bytes in conf pool when parsing 'DefaultRuntimeDir' directive.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1732252 13f79535-47bb-0310-9956-ffa450edef68
2016-02-25 06:51:13 +00:00
Graham Leggett
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
William A. Rowe Jr
9d9b20f5a9 Introduce an ap_get_useragent_host() accessor to replace the old
ap_get_remote_host() in most applications, but preserve the original
behavior for all ap_get_remote_host() consumers (mostly, because we
don't have the request_rec in the first place, and also to avoid any
unintended consequences).

This accessor continues to store the remote_host of connection based
uesr agents within the conn_rec for optimization.  Only where some
other module modifies the useragent_addr will we perform a per-request
query of the remote_host.

(Fixed compilation issues noted by Ranier, applies to 2.4.x trunk,
modulo CHANGES and ap_mmn.h)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729929 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 01:04:58 +00:00
William A. Rowe Jr
db5f097737 Unwind commit 1729901 (and 1729926), it was not ready for trunk
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729928 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 00:46:00 +00:00
Rainer Jung
612f164658 Fix compile error:
- missing semicolons
- s/req/r/

Followup to r1729901


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729926 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 00:18:38 +00:00
William A. Rowe Jr
1dd2be03ad Introduce an ap_get_useragent_host() accessor to replace the old
ap_get_remote_host() in most applications, but preserve the original
behavior for all ap_get_remote_host() consumers (mostly, because we
don't have the request_rec in the first place, and also to avoid any
unintended consequences).

This accessor continues to store the remote_host of connection based
uesr agents within the conn_rec for optimization.  Only where some
other module modifies the useragent_addr will we perform a per-request
query of the remote_host.

(Committed previously, but backed out due to unrelated core.c changes)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729901 13f79535-47bb-0310-9956-ffa450edef68
2016-02-11 21:58:45 +00:00
William A. Rowe Jr
4e46f910d0 Revert r1729897, 1729898, my copy of core.c was polluted by a different patch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729899 13f79535-47bb-0310-9956-ffa450edef68
2016-02-11 21:52:12 +00:00
William A. Rowe Jr
6947916643 Introduce an ap_get_useragent_host() accessor to replace the old
ap_get_remote_host() in most applications, but preserve the original
behavior for all ap_get_remote_host() consumers (mostly, because we
don't have the request_rec in the first place, and also to avoid any
unintended consequences).

This accessor continues to store the remote_host of connection based
uesr agents within the conn_rec for optimization.  Only where some
other module modifies the useragent_addr will we perform a per-request
query of the remote_host.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729897 13f79535-47bb-0310-9956-ffa450edef68
2016-02-11 21:43:32 +00:00
Eric Covener
4b20f3bf3e 1726233 temporarily broke UDS r->handler case sensitivity
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729374 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 12:55:17 +00:00
Eric Covener
38a88646a9 from feedback, assume all parameters to SetHandler are expressions.
I couldnt come up with a plausible handler name that was an 
invalid expression.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726233 13f79535-47bb-0310-9956-ffa450edef68
2016-01-22 15:30:19 +00:00
Rainer Jung
1585b13217 Added many log numbers to log statements that
had none.

Handled all files server/*.c.

Excluded startup error messages in server/config.c
and server/main.c.

I used the coccinelle script provided by Stefan.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725395 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 00:27:36 +00:00
Eric Covener
e89938830a allow expressions to be used in SetHandler. Opt-in with expr= prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725149 13f79535-47bb-0310-9956-ffa450edef68
2016-01-17 23:40:09 +00:00
Yann Ylavic
94f58fdb3a Follow up to r1715876: core directives' tokens are ASCII.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722252 13f79535-47bb-0310-9956-ffa450edef68
2015-12-30 00:22:44 +00:00
Yann Ylavic
3b122da486 Follow up to r1715876: core directives are ASCII.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722251 13f79535-47bb-0310-9956-ffa450edef68
2015-12-30 00:16:50 +00:00
Christophe Jaillet
4dc14cd0c1 Use 'ap_array_str_contains' to simplify code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1719254 13f79535-47bb-0310-9956-ffa450edef68
2015-12-11 04:30:09 +00:00
Christophe Jaillet
7b0b425f7a Revert r1715289 (Connection header field should use "upgrade" instead of "Upgrade")
This is case-insensitive, so no need for such a change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715294 13f79535-47bb-0310-9956-ffa450edef68
2015-11-19 21:54:48 +00:00
Christophe Jaillet
1fc96b332c Connection header field should use "upgrade" instead of "Upgrade"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715289 13f79535-47bb-0310-9956-ffa450edef68
2015-11-19 21:42:23 +00:00
Christophe Jaillet
fba65e6213 Save a few bytes in conf pool when processing 'Define'.
+ some minor style issues
+ split long lines

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1713043 13f79535-47bb-0310-9956-ffa450edef68
2015-11-06 21:59:53 +00:00
Christophe Jaillet
95dc81b422 Save a few bytes in conf pool when processing 'AllowOverrideList'.
The 'override_list' table is allocated from the cmd->pool, just as all strings from argv[].
So there is no need to duplicate them.

+ some minor style issues

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1713040 13f79535-47bb-0310-9956-ffa450edef68
2015-11-06 21:10:57 +00:00
Stefan Eissing
5b5c48e657 first request on master connection only reports more preferred protocols in Upgrade header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710583 13f79535-47bb-0310-9956-ffa450edef68
2015-10-26 12:15:43 +00:00
Stefan Eissing
fb84306e1c disabling protocol upgrades on slave connections
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710572 13f79535-47bb-0310-9956-ffa450edef68
2015-10-26 11:27:08 +00:00