1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-27 16:41:57 +03:00
Commit Graph

245 Commits

Author SHA1 Message Date
Ryan Bloom
59f2a0c5dc Remove the change from earlier tonight to not send a content-length of
0.
Submitted by:	Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86956 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 06:41:37 +00:00
Ryan Bloom
b31bf6e631 Make the header filter decide if a body should be sent. This gives us a
chance to compute the proper content-length before we try to send a set
of headers.  If a handler wants to ignore the HEAD method, then it can
either just return from the handler function or pass an EOS bucket down
the filter stack.  Either method will still get the headers sent to the
client.

This change allows handlers to actually run the request like it is a GET
request.  The core itself will then ensure that no body is sent.  This
allows us to get more information about the request before sending out the
headers for the HEAD request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86954 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 06:07:40 +00:00
Ryan Bloom
66b3a62de8 If the content-length is zero, then we don't output the Content-Length
header file.  The only time that the C-L should be zero is if there is
no body.  Zero is a valid content-length, but the only time that we ever
really send it is on a HEAD request right now, and that is incorrect.
The HEAD response should have the actual content's length.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86953 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 04:52:33 +00:00
Bill Stoddard
a6e345e104 Update coalesce filter to use heap buckets rather than pool buckets. This should fix the
mod_autoindex funky chunking behaviour until the ap_r* routines are reimplemented, at which
time this filter should probably go away.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86943 13f79535-47bb-0310-9956-ffa450edef68
2000-11-13 22:52:19 +00:00
Ryan Bloom
e675d4d73b Get send the content-type header sent correctly for both regular requests
and byteranges.
Submitted by:   Ryan Bloom and Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86942 13f79535-47bb-0310-9956-ffa450edef68
2000-11-13 20:23:41 +00:00
Jeff Trawick
1a13ab6f1e Don't use ap_bucket_read() to find the length unless e->length is
-1.  Otherwise, we'll never use apr_sendfile().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86911 13f79535-47bb-0310-9956-ffa450edef68
2000-11-10 18:04:44 +00:00
Greg Stein
6838403b9e minor tweaks, cleanup, comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86882 13f79535-47bb-0310-9956-ffa450edef68
2000-11-09 10:21:12 +00:00
Ryan Bloom
07390aa8cf Use the content-length filter to compute the content-length for byterange
requests.  This allows the byterange filter to work with the PDF plug-in.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86880 13f79535-47bb-0310-9956-ffa450edef68
2000-11-09 03:33:24 +00:00
Ryan Bloom
8dca57cccd The content-length filter needs to compute the length even if the
content-length has already been set.  If we don't, then we won't know if
the content-length has changed because some other filter changed the
length of the actual data.  We also ALWAYS want to calculate the content
length if we get the whole brigade in the first call to this function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86879 13f79535-47bb-0310-9956-ffa450edef68
2000-11-09 03:00:00 +00:00
Ryan Bloom
4ee1d8eb59 Remove BUFF from the main server. :-) The buff code needs to remain as
a part of the server until the proxy is purged of BUFF however.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86878 13f79535-47bb-0310-9956-ffa450edef68
2000-11-09 00:37:06 +00:00
Jeff Trawick
b0f2ef3556 In the content-length+bytes-sent filter, only set the content length
if we decided to do so initially *and* we've seen all the data.

Prior to this change, for a http/1.1 request to mod_autoindex, the
unconditional call to ap_set_content_length() gave us the wrong
value (only taking into account the first brigade) and disabled
chunking.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86874 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 20:00:35 +00:00
Greg Stein
2b00b3a71c fix the byterange filter.
there is still some bogosity in there (huge buffer allocs!), and some
optimizations to be made, but this appears to fix byterange handling.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86865 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 11:22:07 +00:00
Ryan Bloom
16d27f0da6 The byte-ranges filter. This looks like it should work, but the
Acrobat plug-in doesn't like it for some reason.  This does work better
than what we currently have, because at least it returns all of the
requested data.  This basically removes all BUFFs from the byte-range
code and removes all of the byte-range code from the default-handler.

Byte-ranges are now handled by a filter, which makes sense, and it allows
us to handle byte-ranges for all requests, not just files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86864 13f79535-47bb-0310-9956-ffa450edef68
2000-11-08 06:24:47 +00:00
Greg Stein
754480fd2d Use apr_off_t for the content length, rather than long. Propagate through
the byterange handling and ap_set_content_length().

[ ap_each_byterange() remains as an apr_size_t* so we don't mess up callers ]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86860 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 22:41:09 +00:00
Ryan Bloom
134dbc9e7a Convert a lot of apr_ssize_t to apr_size_t. We don't ever accept or return
signed values in these integers, and we return the error codes directly,
so we should always report the number of bytes read/written correctly.  If
we have an error, that is 0 bytes.  If that is true, then using signed
values doesn't make any sense.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86857 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 20:21:55 +00:00
Ryan Bloom
b6f8c9c68a Remove the original ap_send_fd code. The filters have been working for a
while, and this is cluttering up the code.  If it is really needed, it
can be found in CVS


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86856 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 18:09:47 +00:00
Jeff Trawick
4cb7090063 Get rid of unused variable zero in ap_send_http_options().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86854 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 12:18:45 +00:00
Ryan Bloom
d6cf339824 Always compute the content-length regardless of whether it is sent to the
client or not.  The reason for this, is that it allows us to log the
bytes sent to the client correctly.  This also simplifies the
content-length filter a bit, by making it a single pass through the
brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86852 13f79535-47bb-0310-9956-ffa450edef68
2000-11-07 00:58:49 +00:00
Ryan Bloom
895794d262 ap_send_fd should not be sending an EOS bucket, so we should remove any
trace of that possibility from the code.  First of all, there is nothing
that says you can only send one file bucket in a response, and second,
even if a handler sends a file, nothing says that it can't add text before
or after it too.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86846 13f79535-47bb-0310-9956-ffa450edef68
2000-11-06 20:43:19 +00:00
Ryan Bloom
231c702237 Clean up blocking and non-blocking reads from buckets. The only bucket
that works correctly right now is sockets, but pipes are coming next.
This also makes the http_header_filter do AP_MODE_PEEK correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86830 13f79535-47bb-0310-9956-ffa450edef68
2000-11-04 01:30:37 +00:00
Ryan Bloom
7a1ec9c35c Sub requests should never get into the http headers filter, so we remove
the check for it, and through in an ASSERT.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86829 13f79535-47bb-0310-9956-ffa450edef68
2000-11-03 22:35:52 +00:00
Sascha Schumann
6d89d14d4e Remove REQUEST_CHUNKED_PASS and change ap_discard_request_body()
to use REQUEST_CHUNKED_DECHUNK.

Because of this change, the need for handle_request_body() is gone,
so we remove that as well.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86827 13f79535-47bb-0310-9956-ffa450edef68
2000-11-03 17:34:59 +00:00
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