1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

523 Commits

Author SHA1 Message Date
Jeff Trawick
fdfcc2df5a Change the content-length filter to give up (i.e., not provide content-length)
if it gets a flush bucket.  A generator of streaming content needs to send down
a flush bucket (e.g., by calling ap_rflush()) if it wants to send a partial
response to the client immediately.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86826 13f79535-47bb-0310-9956-ffa450edef68
2000-11-03 16:38:28 +00:00
Ryan Bloom
4cc33e90f7 It doesn't make any sense to set a CHUNK flag in the BUFF, because the
BUFF isn't used for output anymore.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86811 13f79535-47bb-0310-9956-ffa450edef68
2000-11-02 22:53:57 +00:00
Ryan Bloom
5e747a7d64 Remove some more BUFF code. This makes the 100 continue code use buckets
instead of BUFF.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86807 13f79535-47bb-0310-9956-ffa450edef68
2000-11-02 21:10:29 +00:00
Jeff Trawick
7bf310d027 ap_http_header_filter() can't remove itself until after we the
CHUNK filter has been added.  Otherwise, f->next won't be the
CHUNK filter and thus the first brigade won't be chunked
properly.
Reported by:	wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86799 13f79535-47bb-0310-9956-ffa450edef68
2000-11-02 15:42:56 +00:00
Jeff Trawick
46c701dc7f Create the pool bucket after we know the true length, because
(currently) we can't shorten the length of such a bucket by
setting e->length.  (We could split and then remove the extra
bucket, but this seems cleaner.  We may still want to have a
way to shorten a bucket, but there isn't a pressing need for
that at the moment.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86790 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 18:42:55 +00:00
Jeff Trawick
339bd0b7e4 Don't include a '\0' in the header. (I'm still seeing more binary stuff
in the header, but one fix at a time...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86789 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 18:24:11 +00:00
Jeff Trawick
906a993109 Get rid of a couple of buff calls by manipulating the APR socket
timeout directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86786 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 15:44:42 +00:00
Ryan Bloom
6f896b6d55 Forgot one variable when I re-created the patch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86783 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 06:05:00 +00:00
Ryan Bloom
223355decb Fix canned-errors and OPTIONS requests, so that we don't allocate 8k
for the headers.  We count the number of bytes we expect to get and only
allocation that many bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86782 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 06:02:22 +00:00
Ryan Bloom
7998ed4b01 Stop always allocating 8k for each request. We now count the number
of bytes required for the headers for each request, and we just allocate
that number of bytes plus 100 extra.  The extra 100 are a fudge factor,
because it is a bit difficult to compute the exact length for the
basic HTTP headers like date and the status line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86781 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 05:15:25 +00:00
Ryan Bloom
4b1eefe1f4 Clean up the http filter a lot. Instead of sending a bucket per header,
we now create a single bucket that has all of the headers and send that.
One known issue is that this limits the headers to 8k, but it is a minor
patch to fix that.

This also stops us from exporting ap_send_header_field.  This function no
longer makes sense to export.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86780 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 00:52:06 +00:00
Ryan Bloom
8ef77218c1 Remove a BUFF function that isn't used anyplace.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86779 13f79535-47bb-0310-9956-ffa450edef68
2000-11-01 00:08:33 +00:00
Jeff Trawick
7ccd0d2605 a couple of fixes for byte ranges:
. use %qx format instead of %llx for 64-bit integer (apr_time_t);
  %llx prints as "%llx"
. pass offset and length to ap_bucket_create_mmap() so that byte
  ranges work with mmaps (at least for a single range)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86777 13f79535-47bb-0310-9956-ffa450edef68
2000-10-31 19:59:09 +00:00
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