1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

1931 Commits

Author SHA1 Message Date
Yann Ylavic
f673148e9b http: Enforce consistently no response body with both 204 and 304 statuses.
Provide AP_STATUS_IS_HEADER_ONLY() helper/macro to check for 204 or 304 and
use it where some special treatment is needed when no body is expected.

Some of those places handled 204 only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837056 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 13:08:23 +00:00
Ruediger Pluem
81e420cfb0 * mod_proxy: Remove load order and link dependency between mod_lbmethod_*
modules and mod_proxy by providing mod_proxy's ap_proxy_balancer_get_best_worker
  as an optional function.

PR: 62557


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836381 13f79535-47bb-0310-9956-ffa450edef68
2018-07-20 19:27:31 +00:00
Yann Ylavic
3fdba065dd core: axe data_in_in/output_filter from conn_rec.
They were superseded by ap_filter_should_yield() and ap_run_in/output_pending()
in r1706669 and had poor semantics since then (we can't maintain pending
semantics both by filter and for the whole connection).

Register ap_filter_input_pending() as the default input_pending hook (which
seems to have been forgotten in the first place).

On the MPM event side, we don't need to flush pending output data when the
connection has just been processed, ap_filter_should_yield() is lightweight and
enough to determine whether we should really enter write completion state or go
straight to reading. ap_run_output_pending() is used only when write completion
is in place and needs to be completed before more processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836364 13f79535-47bb-0310-9956-ffa450edef68
2018-07-20 15:47:16 +00:00
Yann Ylavic
8d0a14e3e8 core: integrate data_in_{in,out}put_filter to ap_filter_{in,out}put_pending().
Straightforward for ap_filter_input_pending() since c->data_in_input_filter is
always checked wherever ap_run_input_pending(c) is.

For ap_filter_output_pending(), this allows to set c->data_in_output_filter in
ap_process_request_after_handler() and avoid an useless flush from mpm_event.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836239 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 22:36:19 +00:00
Yann Ylavic
ed8996d9a0 core: Add ReadBufferSize, FlushMaxThreshold and FlushMaxPipelined directives.
ReadBufferSize allows to configure the size of read buffers, for now it's
mainly used for file buckets reads (apr_bucket_file_set_buf_size), but it could
be used to replace AP_IOBUFSIZE in multiple places.

FlushMaxThreshold and FlushMaxPipelined allow to configure the hardcoded
THRESHOLD_MAX_BUFFER and MAX_REQUESTS_IN_PIPELINE from "util_filter.c".
The former sets the maximum size above which pending data are forcibly flushed
to the network (blocking eventually), and the latter sets the number of
pipelined/pending responses above which they are flushed regardless of whether
a pipelined request is immediately available (zero disables pipelining).

Larger ReadBufferSize and FlushMaxThreshold can trade memory consumption for
performances with the capacity of today's networks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836032 13f79535-47bb-0310-9956-ffa450edef68
2018-07-16 12:49:55 +00:00
Yann Ylavic
823a630e80 util_filter: Axe conn_rec->empty brigade.
Since it's internal util_filter use, we shouldn't expose it in conn_rec and
can replace it with a pooled brigade provided by ap_reuse_brigade_from_pool().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836020 13f79535-47bb-0310-9956-ffa450edef68
2018-07-16 11:20:26 +00:00
Yann Ylavic
eb5e821bea core: Add ap_reuse_brigade_from_pool().
Current RETRIEVE_BRIGADE_FROM_POOL macro from "http_request.c" is turned into
a helper and used in ap_request_core_filter().

We will need it in a subsequent commit in "util_filter.c" too.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836018 13f79535-47bb-0310-9956-ffa450edef68
2018-07-16 11:06:57 +00:00
Yann Ylavic
abab1d4cc1 util_filter: keep filters with aside buckets in order.
Read or write of filter's pending data must happen in the same order as the
filter chain, thus we can't use an apr_hash_t to maintain the pending filters
since it provides no garantee on this matter.

Instead use an APR_RING maintained in c->pending_filters, and since both the
name (was c->filters) and the type changed, MAJOR is bumped (trunk only code
anyway so far).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1835640 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 13:03:35 +00:00
Yann Ylavic
7711d39400 Avoid cyclic dependency by moving ap_set_etag() from module http to core.
This function, along with ap_make_etag(), is used by the default_handler in
core.c, and in several modules other than builtin mod_http, breaking static
linking and httpdunit tests build.

The move is done by "svn move modules/http/http_etag.c server/util_etag.c".
MMN major bumped, not backportable (as is) to 2.4.x.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833083 13f79535-47bb-0310-9956-ffa450edef68
2018-06-06 21:04:21 +00:00
Christophe Jaillet
3cc71fb73d Fix typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1832277 13f79535-47bb-0310-9956-ffa450edef68
2018-05-25 20:40:27 +00:00
Yann Ylavic
fab86dcf0e Axe ap_rgetline_core(), not used anymore.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829790 13f79535-47bb-0310-9956-ffa450edef68
2018-04-22 15:58:18 +00:00
Yann Ylavic
5738365023 http: add ap_fgetline() and AP_GETLINE_NONBLOCK flag.
It allows to read a line directly from an input filter, in blocking mode
or not. Since no request_rec is needed, a pool may be given.

Existing ap_[r]getline() function are now based off ap_fgetline() by calling:
    ap_fgetline(s, n, read, r->proto_input_filters, flags, bb, r->pool);

Will follow up with a new ap_get_mime_headers_*() flavor which can be used by
any filter that needs non-blocking and not necessarily has a request_rec (e.g.
ap_http_filter() to read proxied response trailers).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829659 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 14:30:19 +00:00
Yann Ylavic
3360700b53 core: Add and handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core().
This tells the ap_getline() family of functions to consume the end of line
when the buffer is exhausted.

PR 62198.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829557 13f79535-47bb-0310-9956-ffa450edef68
2018-04-19 15:01:10 +00:00
William A. Rowe Jr
29c346e09e Guess at fixing win32 build regression on trunk introduced by r1734656
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829381 13f79535-47bb-0310-9956-ffa450edef68
2018-04-17 17:57:13 +00:00
Eric Covener
bd1ccf5f0a PR62199: add worker parameter ResponseFieldSize to mod_proxy
Submitted By: Hank Ibell
Committed By: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828926 13f79535-47bb-0310-9956-ffa450edef68
2018-04-11 19:11:52 +00:00
Christophe Jaillet
3e56c5b221 Fix some typos reported in PR 59998
Most add already been fixed when PR 59990 had been applied on trunk. 

Thx klemens

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827669 13f79535-47bb-0310-9956-ffa450edef68
2018-03-24 20:05:19 +00:00
Christophe Jaillet
005ffe14d8 Fix some doxygen comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827529 13f79535-47bb-0310-9956-ffa450edef68
2018-03-22 21:07:02 +00:00
William A. Rowe Jr
d771a84dbf Correctly identify origin of util_pcre.c/ap_regex.h as pcreposix[.ch]
and correct LICENSE/NOTICE to match.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824973 13f79535-47bb-0310-9956-ffa450edef68
2018-02-21 14:56:01 +00:00
Yann Ylavic
9a139dfa4e mpm_event: follow up to r1823047 and r1824464.
MMN bump for CONN_STATE_NUM, plus don't consider CONN_STATE_LINGER_* as valid
states returned process_connection (never have been).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824862 13f79535-47bb-0310-9956-ffa450edef68
2018-02-20 12:30:59 +00:00
Graham Leggett
2b92ff77a7 core: Create a conn_config_t structure to hold an extendable core config rather
than consuming the whole pointer with the connection socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824635 13f79535-47bb-0310-9956-ffa450edef68
2018-02-17 21:39:53 +00:00
Graham Leggett
dd87ac0747 Add MMN bump for AP_REG_DOLLAR_ENDONLY, ap_regcomp_get_default_cflags
ap_regcomp_set_default_cflags and ap_regcomp_default_cflag_by_name


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824470 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 13:23:26 +00:00
Yann Ylavic
73bcdfae56 mpm_event: follow up to r1823047: complete state validation after processing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824464 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 13:04:43 +00:00
Graham Leggett
fd74115405 MMN bump for hostname_ex in proxy_worker_shared.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824457 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 12:44:57 +00:00
Yann Ylavic
2c21956d95 regex: Allow to configure global/default options for regexes.
Like caseless matching or extended format, which may be useful as default
behaviour the whole configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824339 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 17:53:24 +00:00
Yann Ylavic
d69ddeb1a2 mod_proxy: follow up to r1667707: MMN minor bump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824332 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 17:21:52 +00:00
Stefan Eissing
8115db95a0 On the trunk:
adding AP_DECLARE for ap_parse_vhost_addrs() and minor bumb mmn. Resolves
     building mod_ssl on Windows. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822872 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 12:37:51 +00:00
Rainer Jung
3d26cb0eb6 Happy New Year 2018
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1820101 13f79535-47bb-0310-9956-ffa450edef68
2018-01-04 15:15:21 +00:00
Eric Covener
0b456ba7a7 mmn bump for r1820098.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1820099 13f79535-47bb-0310-9956-ffa450edef68
2018-01-04 15:13:50 +00:00
Eric Covener
98e9503120 Add "AcceptErrorsNonFatal" directive
This tweaks accept() failure processing by having ap_unixd_accept
pass more errors up, and having the MPM's check against a macro
to see if they are in a whitelist of non ENETDOWN/EMFILE kind 
of potential process-wide errors.

Default behavior is still to exit.

edit: MMN bump in 1820099.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1820098 13f79535-47bb-0310-9956-ffa450edef68
2018-01-04 15:10:45 +00:00
Daniel Ruggeri
db07c9c000 Post 2.5.0-alpha tag updates
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1814549 13f79535-47bb-0310-9956-ffa450edef68
2017-11-08 01:13:42 +00:00
Yann Ylavic
14716ce0e0 Follow up to r1812193: really change MMN major.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812197 13f79535-47bb-0310-9956-ffa450edef68
2017-10-14 17:27:21 +00:00
Yann Ylavic
1ee7b9348b Follow up to r1740928: including NOT_IN_PROXY in NOT_IN_DIR_LOC_FILE is both
incomplete and not backportable, fix it by introducing NOT_IN_DIR_CONTEXT and
restoring NOT_IN_DIR_LOC_FILE to its previous value.

Per ap_check_cmd_context(), NOT_IN_DIR_LOC_FILE actually/really means "not in
any directory context", while the definition itself does not include all the
existing directory contexts (e.g. <Limit>, or <Proxy> before r1740928).

This is a bit of a misnomer, at least, so instead of (ab)using it by adding the
missing contexts (in an incompatible way), let's define NOT_IN_DIR_CONTEXT to
really exclude all directory context (i.e. NOT_IN_DIR_LOC_FILE + NOT_IN_LIMIT +
NOT_IN_PROXY) and use it wherever NOT_IN_DIR_LOC_FILE was used.

This is by itself a major MMN bump (modules not compiled with this commit and
having directives checked against NOT_IN_DIR_LOC_FILE won't be caught the same
way by NOT_IN_DIR_CONTEXT in the new ap_check_cmd_context() code), but with the
below change, 2.4.x should work as before:

-   if ((forbidden & NOT_IN_DIR_CONTEXT) == NOT_IN_DIR_CONTEXT) {
+   if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
        if (cmd->path != NULL) {
            return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
-                           " cannot occur within directory context", NULL);
+                           " cannot occur within <Directory/Location/Files/Proxy> "
+                           "section", NULL);
        }
        ...
    }



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812193 13f79535-47bb-0310-9956-ffa450edef68
2017-10-14 16:27:14 +00:00
Yann Ylavic
08ddf7ad0a ap_expr: open string expressions to the <word>.
Introduces the syntax "%{:<word>:}", borrowed from the <var>'s one, and which
likewise can be embedded anywhere in a string expression (the same reserved
character ':' gets reused in an unambiguous manner).

This allows the two types of expressions (boolean and string) to now share
fully the same language set, namely: strings, lists, vars, regexes, backrefs,
functions with multiple or complex arguments, and especially combinations
thereof.

Most of them were reserved to boolean expressions only, while complex string
constructions can also benefit to, well, strings. The <word> construct allows
that (say the syntax "%{:<word>:}" looks like a temporary variable constructed
in a string).

Since string expressions may now have to deal with lists (arrays), they also
need a way to produce/extract strings from list and vice versa. This can be
done with the new "join" and "split" operators, while the new substitution
regexes (like "s/<pattern>/<substitute>/<flags>") may be used to manipulate
strings in place. All this of course available for both string and boolean
expressions.

Tests and doc updates upcoming..



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1810605 13f79535-47bb-0310-9956-ffa450edef68
2017-10-02 21:57:26 +00:00
Yann Ylavic
93d13598d5 config: follow up to r1809302.
Associate ap_get_module_flags() to MMN bump.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809314 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 13:25:15 +00:00
Yann Ylavic
9156671542 config: follow up to r1809302.
Provide a convenient function to get module flags, and remove useless
AP_MODULE_HAS_FLAGS checks in the core, core's version is at current MMN.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809311 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 13:13:44 +00:00
Yann Ylavic
22b024abd8 config: follow up to r1809302.
We need to check that the module itself is at the right version.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809305 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 12:31:54 +00:00
Yann Ylavic
e18300e525 config: allow to specify flags when registering modules.
First one is AP_MODULE_FLAG_ALWAYS_MERGE.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809302 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 11:58:53 +00:00
Stefan Eissing
759fb306d8 On the trunk:
mpm_common.h: guarding AP_ENABLE_EXCEPTION_HOOK against use when undefined so that -Wundef does not triggger.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809135 13f79535-47bb-0310-9956-ffa450edef68
2017-09-21 09:20:14 +00:00
Yann Ylavic
21160f8864 core, mpm_event: Add ap_update_sb_handle() to avoid a small memory leak of
sizeof(ap_sb_handle_t) when re-entering event's process_socket().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1802618 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 17:22:05 +00:00
Jim Jagielski
eb03bf18ef Make case insensitive
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799425 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 10:54:44 +00:00
Jacob Champion
e0852fd12e 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

(This was originally added to the httpdunit feature/backport branch in
r1796208, then reverted in r1799376, since it's currently intended for
trunk only.)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799380 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 23:55:20 +00:00
Jacob Champion
734d6332aa CVE-2017-3167: add documentation to ap_get_basic_auth_pw()
Now that we've released, add clarifying comments to the now-deprecated
API.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799374 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 23:08:18 +00:00
Eric Covener
92ab67cbad core: deprecate and replace ap_get_basic_auth_pw
*) core: Deprecate ap_get_basic_auth_pw() and add 
    ap_get_basic_auth_components(). 

Submitted By: Emmanuel Dreyfus <manu netbsd.org>, Jacob Champion, Eric Covener
CVEID: CVE-2017-3167


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1796348 13f79535-47bb-0310-9956-ffa450edef68
2017-05-26 21:29:59 +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
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
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
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
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
Christophe Jaillet
e0f539c438 Move definition of ASCII_ZERO to httpd.h and rename it ZERO_ASCII for consistancy reason.
Remove definition of ASCII_CRLF which is the same as CRLF_ASCII.

Use ZERO_ASCII and CRLF_ASCII in mod_proxy_http

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777611 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 13:58:03 +00:00