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
William A. Rowe Jr
72a1fee16c OPTIONS request crashed server, this fixes it
Submitted by:	Joe Orton
Reviewed by:	W Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87504 13f79535-47bb-0310-9956-ffa450edef68
2000-12-21 21:09:56 +00:00
Allan K. Edwards
e3cf0931a3 prevent crash when connection closed before complete request received
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87478 13f79535-47bb-0310-9956-ffa450edef68
2000-12-21 01:44:28 +00:00
Greg Ames
8b80bbc18b Send HTTP status line in ascii from ebcdic boxes...makes browsers much happier.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87467 13f79535-47bb-0310-9956-ffa450edef68
2000-12-20 23:13:01 +00:00
Ryan Bloom
072741059e Make the server return HTTP_RANGE_NOT_SATISFIABLE if the all of the
requested ranges begin after the end of the response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87390 13f79535-47bb-0310-9956-ffa450edef68
2000-12-17 20:58:30 +00:00
Ryan Bloom
b34037db5e Get byterange requests working with data that is generated by a handler
that does not add a content-length.  For example, mod_autoindex doesn't
set a content-length, but the byterange filter requires one.  We fix this
by computing the content-length in the byterange filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87389 13f79535-47bb-0310-9956-ffa450edef68
2000-12-17 18:04:14 +00:00
Ryan Bloom
02ce223e3a Get Apache filters and Apr-util buckets using the same values for
blocking and non-blocking reads.  This allows us to use the mode parameter
passed to a filter to read from the bucket correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87256 13f79535-47bb-0310-9956-ffa450edef68
2000-12-08 01:26:31 +00:00
Ryan Bloom
cc58804018 Remove an incorrect comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87239 13f79535-47bb-0310-9956-ffa450edef68
2000-12-07 00:17:52 +00:00
Greg Stein
ead2dae94c *) Compensate for recent changes in the APR headers. Specifically, some
files need to specifically include stdio.h, or a particular apr_*.h
   header.

*) Adjust callers of apr_create_process() to deal with the extra "const"

*) Add "const" to args of ap_os_create_privileged_process()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87080 13f79535-47bb-0310-9956-ffa450edef68
2000-11-26 04:47:43 +00:00
Ryan Bloom
a90554d578 Next pass at the content-length filter. Not perfect quite yet, but
getting closer
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87058 13f79535-47bb-0310-9956-ffa450edef68
2000-11-22 00:40:20 +00:00
Ryan Bloom
798d259441 Modify the content-length filter to change the criteria used to determine
if/when we compute the content-length.  There are just a few cases now:

        1) We already have all the data
        2) We don't have all the data and:
                2a)  This is a 1.1 request but we can't chunk
                2b)  The is a keep-alive request
	    In the future, we probably want to modify this to not
	    be a keep-alive request.

This filter always buffers 9K of data.  The reason is simple, the core will
buffer 9K at a time anyway, and there is a chance that we may get the end
of the request before we hit 9K.  This increases our chances of being able
to send a c-l.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87055 13f79535-47bb-0310-9956-ffa450edef68
2000-11-21 20:17:20 +00:00
William A. Rowe Jr
a1346d5f95 Clean up some timeout arg warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87006 13f79535-47bb-0310-9956-ffa450edef68
2000-11-18 14:43:26 +00:00
Ryan Bloom
4be2035ab6 Fix 204 handling. This moves some logic that used to be in
ap_send_error_response to the http_header filter.  The reason for the move,
is that the header filter takes care of all header processing now.  Without
this change, we were sending garbage data to the client whenever we sent
304 responses.
Submitted by:	Brian Havard and Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87003 13f79535-47bb-0310-9956-ffa450edef68
2000-11-18 04:53:23 +00:00
Bill Stoddard
92abe95d63 Make function definition agree with the declaration, which fixes a compile break on
Windows.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86991 13f79535-47bb-0310-9956-ffa450edef68
2000-11-17 13:57:32 +00:00
Ryan Bloom
4baadb8ef1 This removes all BUFF's from the HTTP proxy. This code is relatively
ugly, but it does proxy pages.  This even fixes the content-type bug
that I introduced yesterday sometime.  As soon as BUFF is removed from
the FTP proxy, the buff.c and buff.h files need to go away.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86988 13f79535-47bb-0310-9956-ffa450edef68
2000-11-17 00:19:30 +00:00
Ryan Bloom
95e93f299d Do not send a content-length if and only if this is a HEAD request and
the content-length is 0.  The problem is that the C-L on a HEAD response
has to be the correct C-L, but if a handler returns saying the handled
the request without sending data, the core sends an EOS down the filter
stack, and we compute a 0 C-L.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86976 13f79535-47bb-0310-9956-ffa450edef68
2000-11-15 22:08:44 +00:00
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