1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

560 Commits

Author SHA1 Message Date
Jeff Trawick
ad7545f0b4 Compute the content length (and add appropriate header field) for
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
2000-10-31 12:30:22 +00:00
Jeff Trawick
bd8f8930e6 EBCDIC support: convert protocol data in getline() and
ap_send_header_field(); change terminate_header() to build the
CRLF in ASCII to begin with.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86752 13f79535-47bb-0310-9956-ffa450edef68
2000-10-26 11:05:07 +00:00
Jeff Trawick
c94fce6af5 Get rid of a // comment so we compile on OS/390 without the funky
compiler option.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86743 13f79535-47bb-0310-9956-ffa450edef68
2000-10-25 11:02:30 +00:00
Ryan Bloom
049e020782 Always send the EOS on the correct request. Basically, we call
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
2000-10-24 16:57:53 +00:00
Jeff Trawick
2932ba2acd The request body should be read with the normal send/receive timeout
instead of in non-blocking mode.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86734 13f79535-47bb-0310-9956-ffa450edef68
2000-10-24 16:28:53 +00:00
Ryan Bloom
9d5f496143 Make ap_rflush use the flush bucket properly, and remove the BUFF code
from that function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86708 13f79535-47bb-0310-9956-ffa450edef68
2000-10-23 10:44:34 +00:00
Bill Stoddard
2a407c1755 Fix problem where a 304 response was not generating an EOS bucket.
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
2000-10-22 15:20:08 +00:00
Jeff Trawick
95b1b283c3 Get HTTP/0.9 and subrequests working again. The http header filter
wasn't letting any assbackwards brigades get past it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86701 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 13:33:58 +00:00
Jeff Trawick
902d55fc14 Get rid of a couple of buff-isms -- setting the B_EOUT flag in a couple
of places and doing ap_bread() in ap_lingering_close.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86700 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 13:20:36 +00:00
Jeff Trawick
807983f2e7 namespace-protect dechunk_filter and http_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86699 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 13:09:23 +00:00
Jeff Trawick
ddf387fdfb Fix the return type of ap_http_header_filter().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86698 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 12:53:59 +00:00
Bill Stoddard
4fd88db134 Fix Win32 compile break introduced by the http_header filter code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86697 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 10:34:05 +00:00
Ryan Bloom
1c795234e1 Add a way to remove output filters. This is used by http_header_filter to
remove itself once it has actually sent the headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86690 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 17:22:28 +00:00
Ryan Bloom
6b22f05745 Fix a broken hack. We should save the state in the ctx pointer, not a
static integer
Submitted by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86689 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 17:07:47 +00:00
Ryan Bloom
9fbdac023f Hack headers to work semi-properly. This is a hack that will need to be
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
2000-10-21 14:20:14 +00:00
Jeff Trawick
96cf82e63b Input filters and ap_get_brigade() now have a input mode parameter
(blocking, non-blocking, peek) instead of a length parameter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86684 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 13:20:36 +00:00
Bill Stoddard
bf1eb0532d Rename buffer_filter to coalesce_filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86683 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 12:38:17 +00:00
Greg Ames
7d6e7a719a getline():
Fix MIME header folding for character mode (telnet) clients.
 Clean up comments & tighten asserts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86669 13f79535-47bb-0310-9956-ffa450edef68
2000-10-19 17:57:42 +00:00
Ryan Bloom
140586d14f Namespace protect the rest of the macros defined by ap_config.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86661 13f79535-47bb-0310-9956-ffa450edef68
2000-10-19 00:05:00 +00:00
Greg Ames
7493daab32 Support HTTP header line folding with input filtering.
Some funkyness remains with Win32 telnet doing folding - that can wait til
tomorrow.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86660 13f79535-47bb-0310-9956-ffa450edef68
2000-10-18 23:22:41 +00:00
Ryan Bloom
0dbda593ad Make the core access the socket directly instead of going through the
BUFF.  This doesn't actually change any behavior, it just makes the core
access socket directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86652 13f79535-47bb-0310-9956-ffa450edef68
2000-10-18 19:32:30 +00:00
Jeff Trawick
7eecd8064e ap_get_client_block() now uses a brigade in core_request_config
instead of a brigade in core_dir_conf.  For now, getline() and
ap_get_client_block() share a brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86647 13f79535-47bb-0310-9956-ffa450edef68
2000-10-18 17:42:44 +00:00
Greg Ames
2311f5561e Add a core_request_config so we have a safe semi-hidden place to save core data
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
2000-10-18 15:21:32 +00:00
Jeff Trawick
b8d35c9bbe ap_get_client_block() allocates its brigade from r->pool (as it was
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
2000-10-17 20:43:35 +00:00
Ryan Bloom
d5bc93eb70 Remove brigade_bgets. Getting the chunk header is now done by getline.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86631 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 18:39:56 +00:00
Jeff Trawick
d67027b3ce http_filter():
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
2000-10-17 17:53:09 +00:00
Ryan Bloom
b61db87313 Remove an incorrect comment. Bucket brigades are allocated out of pools,
if we drop one on the floor, it will get cleaned up when we clean the pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86629 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 17:26:46 +00:00
Jeff Trawick
ac66b6c093 http_filter():
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
2000-10-17 15:28:57 +00:00
Ryan Bloom
894e2e7ab9 Remove some annoying warnings from http_protocol. This is untested, but
it makes sense logically.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86627 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 14:37:46 +00:00
Jeff Trawick
6ace1c8b3b Rename ap_debug_assert() to AP_DEBUG_ASSERT().
This should have been committed with httpd.h a few minutes ago.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86622 13f79535-47bb-0310-9956-ffa450edef68
2000-10-17 01:13:11 +00:00
Ryan Bloom
86a1ecbda0 Add a flush bucket type. This bucket advises filters to flush any data
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
2000-10-17 00:24:36 +00:00
Ryan Bloom
25535f86ec Add a sub-request filter. This filter just strips the EOS from the
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
2000-10-16 23:15:55 +00:00
Greg Ames
d1c3f2e864 simplify bookkeeping in getline() to make it run a little faster, and
(hopefully) be easier to understand in the future.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86617 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 22:10:41 +00:00
Jeff Trawick
456c858fb2 dechunk filter:
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
2000-10-16 20:08:14 +00:00
Jeff Trawick
eb7793f871 input filtering changes:
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
2000-10-16 19:11:53 +00:00
Jeff Trawick
c06c057a8d Get rid of some old code related to the way that character set translation
of protocol data and bodies was performed in the past.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86612 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 18:00:49 +00:00
William A. Rowe Jr
d6490633eb Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
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
2000-10-16 06:05:15 +00:00
Ryan Bloom
b73fb78446 Stop using the index into the array for the bucket type. Now we just use
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
2000-10-15 18:15:13 +00:00
Ryan Bloom
f6a723080f Cleanup ap_get_client_block a bit. All of the code that I am removing
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
2000-10-14 06:53:02 +00:00
Ryan Bloom
1486d62e7e My last patch had most of the code to insert the eos bucket, but it was
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
2000-10-14 06:21:38 +00:00
Ryan Bloom
15fe310d97 Get non-chunked input body filtering working with an EOS bucket. The
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
2000-10-14 04:37:22 +00:00
Jeff Trawick
26db2ffb0c Introduce ap_debug_assert() macro, like ap_assert() but only active if
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
2000-10-13 18:39:18 +00:00
Jeff Trawick
ee1ba0a23f getline() fixes...
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
2000-10-13 17:54:24 +00:00
Ryan Bloom
745e689f7c Remove all function pointers from the ap_bucket type. These function
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
2000-10-13 05:35:57 +00:00
Jeff Trawick
2761c91ac9 Fix a couple of problems related to large request bodies:
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
2000-10-13 03:12:54 +00:00
Greg Ames
44d920dbfc Make http_filter go a little faster. Remove unused #define.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86570 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 19:30:11 +00:00
Ryan Bloom
c27033df76 Implement a length argument on input filters. There are three possible
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
2000-10-12 16:35:39 +00:00
Ryan Bloom
3aed2aae16 A small cleanup for ap_get_client_block.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86561 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 05:40:46 +00:00
Ryan Bloom
08be79365b We never actually store anything in input_data (from the conn_rec), so it
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
2000-10-12 04:47:21 +00:00
Ryan Bloom
b9b414f073 This is pretty much the wrong solution, but at least it makes POSTs work
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
2000-10-12 03:57:45 +00:00