Commit Graph

150 Commits

Author SHA1 Message Date
a920a90838 Axe some redundant conditions. PR 62549.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837941 13f79535-47bb-0310-9956-ffa450edef68
2018-08-13 12:54:30 +00:00
4176ecb142 Follow up to r1837822: typo.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837824 13f79535-47bb-0310-9956-ffa450edef68
2018-08-10 16:32:40 +00:00
3c7f5e2a32 core: ap_filter_output_pending() to flush outer most filters first.
Since previous output filters may use ap_filter_should_yield() to determine
whether they should send more data (e.g. ap_request_core_filter), we need
to flush pending data from the core output filter first, and so on up the
chain.

Otherwise we may enter an infinite loop where ap_request_core_filter() does
nothing on ap_filter_output_pending() called from MPM event.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837822 13f79535-47bb-0310-9956-ffa450edef68
2018-08-10 16:15:50 +00:00
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
9d5281caed util_filter: axe loglevel explicit checks already done by ap_log_cerror().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836241 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 22:43:45 +00:00
69fd1f0642 core: avoid double loop in ap_filter_output_pending().
Since ap_filter_output_pending() is looping on the relevant filters already,
we don't need to use ap_filter_should_yield() to check upstream filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836240 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 22:40:32 +00:00
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
8a6e1c3ada core: core output filter optimizations.
The core output filter used to determine first if it needed to block before
trying to send its data (including set aside ones), and if so it did call
send_brigade_blocking().

This can be avoided by making send_brigade_nonblocking() send as much data as
possible (nonblocking), and only if data remain check whether they should be
flushed (blocking), according to the same ap_filter_reinstate_brigade()
heuristics but afterward.

This allows both to simplify the code (axe send_brigade_blocking and some
duplicated logic) and optimize sends since send_brigade_nonblocking() is now
given all the buckets so it can make use of scatter/gather (iovec) or NOPUSH
option with the whole picture.

When sendfile is available and/or with fine tuning of FlushMaxThreshold (and
ReadBufferSize) from r1836032, one can now take advantage of modern network
speeds and bandwidth.

This commit also adds some APLOG_TRACE6 messages for outputed bytes (including
at mod_ssl level since splitting happens there when it's active).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836237 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 21:55:29 +00:00
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
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
fdea2be62f util_filter: follow up to r1835640: pending_filter_cleanup() precedence.
Register pending_filter_cleanup() as a normal cleanup (not pre_cleanup) so
that the pending filters are still there on pool cleanup, and f->bb is set
to NULL where needed.

Then is_pending_filter() check is moved where relevant.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1835847 13f79535-47bb-0310-9956-ffa450edef68
2018-07-13 16:04:37 +00:00
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
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
106d0761c0 core: fix ap_request_core_filter()'s brigade lifetime.
The filter should pass everything up to and including EOR, then bail out.
For EOR it can't use a brigade created on r->pool, so retain one created
on c->pool in c->notes (this avoids leaking a brigades for each request
on the same connection).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822596 13f79535-47bb-0310-9956-ffa450edef68
2018-01-30 00:58:54 +00:00
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
4fc5798dca Follow up to r1734656, r1736216, r1736225: more correct pointer size semantic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736226 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 18:25:46 +00:00
054f1a98c3 Follow up to r1734656, r1736216: use correct pointer size semantic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736225 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 18:23:08 +00:00
239ac0c076 Follow up to r1734656: restore c->data_in_input_filters usage to
see if it helps unblocking test framework.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736216 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 17:08:29 +00:00
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
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
ee4bafbbae Fix a typo when building a TRACE8 message.
'flush_upto' can never be NULL (or there would be a NULL pointer deference earlier in the code), so the alternate message can never trigger.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725456 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 09:55:25 +00:00
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
4d3a3704a2 Make sure that transient buckets are morphed into real buckets before
the filter returns.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707163 13f79535-47bb-0310-9956-ffa450edef68
2015-10-06 22:38:28 +00:00
2da6c9a57a Add the AsyncFilter directive that allows the asynchronous filter
functionality to be switched off for certain classes of filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707161 13f79535-47bb-0310-9956-ffa450edef68
2015-10-06 22:33:03 +00:00
615f97f933 core: Extend support for asynchronous write completion from the
network filter to any connection or request filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706669 13f79535-47bb-0310-9956-ffa450edef68
2015-10-04 10:10:51 +00:00
42829738d9 Useful extensions...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1458456 13f79535-47bb-0310-9956-ffa450edef68
2013-03-19 19:09:40 +00:00
26d5fb7164 Add some more log message tags
Remove some log message tags from ap_log_* calls that log lots of
different error messages, in particular the config parsing errors.
Not sure how we should handle those.

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG
to TRACE1-3



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1210252 13f79535-47bb-0310-9956-ffa450edef68
2011-12-04 22:09:24 +00:00
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
c88247529e thx sf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206787 13f79535-47bb-0310-9956-ffa450edef68
2011-11-27 18:02:33 +00:00
74aafc6c37 Comment reason for NULL parameter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206159 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 13:30:44 +00:00
f66d79b8b2 Use varargs...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205894 13f79535-47bb-0310-9956-ffa450edef68
2011-11-24 15:53:16 +00:00
d2342460fd Add ap_pass_brigade_fchk() which does a Filter CHecK on the
brigade pass.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205419 13f79535-47bb-0310-9956-ffa450edef68
2011-11-23 14:52:43 +00:00
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
2aef21903c Cleanup... most don't need apr_hooks.h at all...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101067 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 15:36:32 +00:00
46bdc28bf4 fix some logging calls to include the server_rec
(and even the conn_rec in a couple of places)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1074871 13f79535-47bb-0310-9956-ffa450edef68
2011-02-26 15:32:01 +00:00
eccfb6c00c Added http_config.h to make APLOG_USE_MODULE macro visible.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965325 13f79535-47bb-0310-9956-ffa450edef68
2010-07-18 23:37:54 +00:00
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
8026ae5889 Further to r599711; document new API guarantee for handling non-NULL
request_rec pointer when adding connection filters; minor MMN bump:

* server/util_filter.c (add_any_filter_handle): Set f->r for
  connection filters even if passed-in r is non-NULL.  Style nit fix
  also.

* include/util_filter.h (ap_add_output_filter,
  ap_add_output_filter_handle): Document new API guarantee.

* include/ap_mmn.h: Minor MMN bump.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600473 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 10:55:58 +00:00
18f91519df * Use the correct pool when adding connection level filters.
Submitted by: jorton
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599711 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 07:23:55 +00:00
f29b0683a2 * server/util_filter.c (ap_filter_flush): Tweak comment; no functional
change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583830 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 14:13:40 +00:00
c99d2c7276 * server/util_filter.c (ap_filter_flush): Ensure that the brigade is
empty before returning.

PR: 36780


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583817 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 13:18:38 +00:00
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
f193cbabee Make ap_register_output_filter back into a function (*sigh*)
but update its API doc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@315041 13f79535-47bb-0310-9956-ffa450edef68
2005-10-12 20:43:25 +00:00
5134335bee Make ap_register_output_filter a #define
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@315024 13f79535-47bb-0310-9956-ffa450edef68
2005-10-12 20:18:33 +00:00
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
4bc7f40b18 * server/util_filter.c (ap_save_brigade): Be more tolerant of a bucket
type which neither implements ->setaside nor morphs on ->read, such as
the mod_perl SV bucket type in mod_perl <1.99_17; defer returning an
error in this case until after calling setaside on each bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105664 13f79535-47bb-0310-9956-ffa450edef68
2004-11-01 23:04:05 +00:00
c48cfec2fd * server/util_filter.c (ap_save_brigade): Handle an ENOTIMPL setaside
function correctly.

* modules/generators/mod_cgi.c (cgi_handler): Revert r1.169,
unnecessary CGI bucket lifetime kludge.

PR: 31247


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105297 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 15:52:51 +00:00