the response when no content length is available and we can't use
chunked encoding.
This is going to be painful when the response body is huge, so I
suspect we'll have additional criteria in the future.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86775 13f79535-47bb-0310-9956-ffa450edef68
ap_finalize_request_protocol on the main request, then we find the
last internally re-directed request, and send the EOS on that request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86735 13f79535-47bb-0310-9956-ffa450edef68
ap_finalize_request_protocol()'s sole purpose in Apache 2.0 is to
send the EOS bucket. Probably need to reimplement ap_send_error_response()
to be consistent with ap_finalize...'s new mission.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86702 13f79535-47bb-0310-9956-ffa450edef68
fixed, but it is good enough for now. The idea is that headers shouldn't
flow through the BUFF anymore. Now, we have a header filter that is
called at the end of the request-filter chain. This filter writes the
headers directly to the connection filters.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86687 13f79535-47bb-0310-9956-ffa450edef68
that lives across function calls during a single request. Change getline() to
take a request_rec parm (rather than a conn_rec) so we can access the
core_request_config.
This is in preparation for adding look-ahead functionality to getline(), so it
can support header line folding once again. I'm committing these changes first
so the core_request_config can be used elsewhere (i.e. ap_get_client_block).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86642 13f79535-47bb-0310-9956-ffa450edef68
before today) so that we don't have a growth of these across many
pipelined requests.
http_filter() uses one brigade per connection which it reads into.
As it needs to deliver buckets to the caller, they are removed from
its brigade into the caller's brigade.
Submitted by: Ryan Bloom (but anything broken is my fault)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86632 13f79535-47bb-0310-9956-ffa450edef68
get rid of an unnecessary condition where we set ctx->b to NULL;
it was already NULL
ap_get_client_block():
"fix" the pool for the brigade used by ap_get_client_block() to
save its state; this allows pipelined requests to work
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86630 13f79535-47bb-0310-9956-ffa450edef68
when delivering body bytes, only deliver one block of data (however
much is returned by bucket read) instead of delivering the entire
body at once; this gets painful with a large body
make a note of an issue with the blocking state of the socket;
currently, the socket is non-blocking, but when reading body bytes
we should feel free to wait for body bytes until a timeout occurs;
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86628 13f79535-47bb-0310-9956-ffa450edef68
they are currently storing. There is no way we can force them to flush,
but we can advise. This also adds the code to ap_rflush to use flush
buckets, although it isn't enabled yet. I will enable it once we remove
buff from the code. I also removed all calls to ap_rflush that are either
immediately before or immediately after a call to ap_finalize_protocol.
ap_finalize_protocol sends an EOS bucket, which also advises filters to
flush their data, so having both calls right next to each other is
redundant.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86619 13f79535-47bb-0310-9956-ffa450edef68
brigade generated by the sub-request. If this is not done, then the
main-request's core_output_filter will get very confused, as will any other
filter in the main-request filter-stack that looks for EOS.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86618 13f79535-47bb-0310-9956-ffa450edef68
Get rid of an assertion which assumed that HTTP_IN is the filter
below us. Some other filter may play the same role.
ap_setup_client_block():
Get rid of a commented-out hack which was used to allow chunked
transport encoding of a request body received by mod_cgi[d].
ap_get_client_block():
Get rid of special handling for zero-length buckets... The main
loop handles that fine.
Submitted by: Ryan Bloom
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86614 13f79535-47bb-0310-9956-ffa450edef68
get dechunking working
verify that infrastructure for input filters works
(use existing AddInputFilter directive)
Unlike with my previous patch, ap_get_client_block() saves state between
calls in the core's per-request dir config.
Unlike with my previous patch, HTTP_IN keeps a count of remaining bytes
in the conn_rec. Code that needs to prod it to deliver a certain amount
of request body plays with conn_rec->remain directly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86613 13f79535-47bb-0310-9956-ffa450edef68
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
All _VAR_ flavors changes to _DATA to be absolutely clear.
Thank you Greg, for the most obvious suggestion.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86609 13f79535-47bb-0310-9956-ffa450edef68
a pointer to a static structure. The ap_foo_type functions have also been
replaced with simple macro calls. I am going to replace the
ap_bucket_(read|split|setaside|destroy) functions with macros soon.
Reviewed by: Will Rowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86597 13f79535-47bb-0310-9956-ffa450edef68
doesn't actually do anything useful, it was meant to remove all zero
length buckets before trying to read from the brigade. However, it is
perfectly fine to not do this, and to just read those buckets along with
the rest of them.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86589 13f79535-47bb-0310-9956-ffa450edef68
missing some major pieces that I only found after the commit. This patch
fixes the problem, and makes sure that request bodies are always ended
with an EOS bucket.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86588 13f79535-47bb-0310-9956-ffa450edef68
basic design has ap_setup_client_block setting a field in the conn_rec
which tells http_filter how much data is in the body (with chunking this
will represent how much data is in the chunk). The ap_get_client_block
then calls down the stack with the maximum amount of data that it can
receive back. When http_filter reads all of the data, it adds an eos
bucket to the end of the brigade. ap_get_client_block continues to read
data until it gets the eos bucket. This allows filters to increase the
size of the body data.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86586 13f79535-47bb-0310-9956-ffa450edef68
AP_DEBUG is defined.
ap_get_client_block():
. avoid some cases where we leak a temporary bucket brigade
. clean up/fix the logic to copy a brigade into the caller's buffer;
the wrong length was used in some cases
. add an AP_DEBUG-only assertion for some assumptions made regarding
the brigade returned by the filters
Submitted by: partly by Greg Stein, but of course anything bad is mine
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86583 13f79535-47bb-0310-9956-ffa450edef68
If ap_get_brigade() returns APR_SUCCESS but an empty brigade, bail out.
Previously, we kept going and sometimes segfaulted while operating on
what we thought was the first bucket.
Free the temporary brigade used by getline().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86581 13f79535-47bb-0310-9956-ffa450edef68
pointers are replaced with a global table that allows modules to register
their bucket types. Those bucket types are then allowed to be used in
the server processing. This also required removing all direct calls to
those functions. The ap_bucket type has an index into an array, so in
each ap_bucket_* function, we use that index to find the correct set of
functions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86575 13f79535-47bb-0310-9956-ffa450edef68
http_filter() - this was referencing e->length even though e->length
is sometimes -1 (if we have to read the socket bucket to get the
next bit of the request body); now it does e->read() to force a
socket need if required
ap_get_client_block() - this was getting a brigade back with the
desired amount of data (yeah, right) but only copying out the first
bucket
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86573 13f79535-47bb-0310-9956-ffa450edef68
values for the length, -1, 0, and a positive number. -1 means that the
next filter should return all the data it has, the current filter will
take care to ensure that the protocol is followed. Most filters will
never use this, because it implies they are implementing a conn_based
input filter. 0 means give me exactly one line of data. A positive
number means give me a maximum of n bytes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86567 13f79535-47bb-0310-9956-ffa450edef68
doesn't make much sense to check to see if there is something there. This
removes the input_data brigade from the conn_rec altogether. There is no
good reason for a filter to be accessing a bucket brigade from within the
conn_rec. This shouldn't be here anymore, just like the output_filter
shouldn't be storing the data in the conn_rec.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86560 13f79535-47bb-0310-9956-ffa450edef68
again. Chunking input doesn't work with this change, but that is because
this is a stop-gap to get POSTs working again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86555 13f79535-47bb-0310-9956-ffa450edef68