1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

482 Commits

Author SHA1 Message Date
Greg Ames
4ef361c9fb fix mangled headers due to underallocated buffer
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87856 13f79535-47bb-0310-9956-ffa450edef68
2001-01-26 18:48:57 +00:00
Ryan Bloom
f793712889 Teach me to change just one more thing before committing. This fixes my
last commit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87855 13f79535-47bb-0310-9956-ffa450edef68
2001-01-26 17:57:55 +00:00
Ryan Bloom
e13b493fac Stop using the request filters to filter an error response. This fixes a
bug where we were using the byterange filter to filter an error, which
caused us to close the connection before we had sent any data.  Currently,
we only keep the three most important filters, but we may need to add more
in the future.  I am mostly thinking of the charset translation filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87854 13f79535-47bb-0310-9956-ffa450edef68
2001-01-26 17:54:06 +00:00
Brian Havard
6d396cd546 Fix uninitialized variable 'written' in ap_rvputs, noticed by gcc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87849 13f79535-47bb-0310-9956-ffa450edef68
2001-01-26 02:53:50 +00:00
Ryan Bloom
2b21bf6dfd Store the original content_type before we replace it with the byterange
C-T.  This allows us to report a correct content type in the boundary
header.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87845 13f79535-47bb-0310-9956-ffa450edef68
2001-01-25 23:50:33 +00:00
Ryan Bloom
b7ba872c74 As Greg noted, set_keepalive has to happen before we check r->chunked, but
it also has to happen after ap_basic_http_header.  Otherwise, we don't
set r->connection->keepalive correctly, and it can be -1 for requests that
don't support keepalive.  This moves ap_basic_http_header to above the
call to set_keepalive (after reversing the previous patch), which should
be perfectly safe, while still fixing the original bug.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87824 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 23:47:42 +00:00
Ryan Bloom
c422d96754 The ap_set_keepalive call needs to be after the call to
ap_basic_http_header.  Without this, there are times that HTTP 1.0
requests will do keepalive connections.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87823 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 23:07:23 +00:00
Bill Stoddard
3f2a46a998 Remove the COALESCE_FILTER. It is no longer needed since Greg committed his ap_r*
buffering patch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87821 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 22:47:57 +00:00
Greg Stein
c8d300bd44 Begin mod_core.h for CORE-private information. Ideally, AP_CORE_DECLARE
function decl's and CORE_PRIVATE header info should all move into this
header.

Start with moving the filter function declarations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87808 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 02:14:23 +00:00
Greg Stein
3d03cd34e2 fix the (error) return values for the ap_r* functions.
Submitted by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87806 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 01:42:41 +00:00
Greg Stein
7ac64ef4c5 Improve the performance of the ap_r* functions by buffering their data in
[the context of] a new filter ("OLD_WRITE").

Further information/discussion of this patch is available on new-httpd
between Jan 16 and Jan 23, 2001.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87804 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 01:31:00 +00:00
Ryan Bloom
41319e0238 Fix the byterange filter for the case where the bucket can't be
copied natively.  This will only ever happen if a bucket can be split
but not copied, because we read the bucket in apr_brigade_partition if
we can't split it.  Regardless, this is much safer.  This should also fix
all of the problems with the byterange filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87793 13f79535-47bb-0310-9956-ffa450edef68
2001-01-23 07:30:11 +00:00
Ryan Bloom
86f5376a39 Cleanup the byterange filter to use the apr_brigade_partition
and apr_bucket_copy functions.  This removes a lot of very messy
code, and hopefully makes this filter more stable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87791 13f79535-47bb-0310-9956-ffa450edef68
2001-01-23 05:57:32 +00:00
Ryan Bloom
7bfd9bc68c AP_REQUEST_DONE is bogus and a bad idea. This had the http_header filter
return -3 for every HEAD request, which in turn made us call ap_die.  Of
course, if we didn't have a 200 status (say we had a 206), then we would
seg fault, because we would end up sending down a second EOS bucket, which
would in turn make us call the byterange filter again, but at this point,
we hadn't cleaned up the byterange ctx structure, because it was never
supposed to be called again.

This was biting us on apache.org, where we had a HEAD request for
bytes=100- for a file.  This was a major seg fault.  We are better off
just returning OK is much safer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87788 13f79535-47bb-0310-9956-ffa450edef68
2001-01-22 21:57:57 +00:00
William A. Rowe Jr
59bbd68bec The big change. This is part 3 of the apr-util symbols rename, please
see the first commit of srclib/apr-util/include (cvs apr-util/include)
  for the quick glance at symbols changed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87731 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 07:04:36 +00:00
Tony Finch
5e2b16e83f Fix the RFC number mentioned when complaining about a missing
Host: header.

PR:             7079
Submitted by:   Alexey Toptygin <alexeyt@wam.umd.edu>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87717 13f79535-47bb-0310-9956-ffa450edef68
2001-01-18 21:04:44 +00:00
Jeff Trawick
ad75d6e533 Fix a segfault in ap_http_filter(). I hit the segfault while
discarding the body of a request, but it could affect other paths.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87684 13f79535-47bb-0310-9956-ffa450edef68
2001-01-15 15:40:17 +00:00
Jeff Trawick
8ae90fca38 EBCDIC: Fix some byterange protocol data translation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87571 13f79535-47bb-0310-9956-ffa450edef68
2001-01-02 19:22:09 +00:00
Ryan Bloom
ebbd77a687 We never use MMAP_SEGMENT_SIZE, and we are better off determining if we
have MMAP, by just checking with APR, instead of using an Apache
definition which doesn't really control anything anymore.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87563 13f79535-47bb-0310-9956-ffa450edef68
2001-01-01 00:34:25 +00:00
Jeff Trawick
b38b38dc22 ap_content_length_filter(): if ap_save_brigade() fails, tell the caller
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87549 13f79535-47bb-0310-9956-ffa450edef68
2000-12-29 13:59:19 +00:00
Jeff Trawick
d21e75657c On EBCDIC machines, fix up the charset of the header terminator.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87542 13f79535-47bb-0310-9956-ffa450edef68
2000-12-28 22:23:34 +00:00
Ryan Bloom
d1df8342b5 Ignore CRLF (or LF) when PEEK'ing at data on the socket. The general
problem is that some browsers send an extra line at the end of a POST
request.  We use the PEEK method to determine if there is any data left
on the socket, if there is then we delay sending the response until we
have enough data to make it worthwhile.  If the browser sends an extra
blank line, we don't want to delay the response at all.  The only time
we use the PEEK method is to check for a second request, so this is safe
to do.

This also solves Joe Orton's problem of specifying a Content- Length
of 1 for a blank line, and having the server wait to send back a response.
The problem is that Linux (all Unix really) sends two characters \r\n for
a blank line, so specifying a C-L of 1 means that the server still sees
a \n when it PEEKs that the socket data.  That \n can be safely ignored
however.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87540 13f79535-47bb-0310-9956-ffa450edef68
2000-12-28 01:14:22 +00:00
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