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
Ryan Bloom
e845552895 Move ap_set_last_modified to the core. This is a potentially
controversial change, because this is kind of HTTP specific.  However
many protocols should be able to take advantage of this kind of
information.  I expect that headers will need one more layer of
indirection for multi-protocol work, but this is a small step in
the right direction.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88580 13f79535-47bb-0310-9956-ffa450edef68
2001-03-25 20:42:47 +00:00
Jeff Trawick
9b13772f87 Handle ap_discard_request_body() being called more than once.
Add a debug assertion to verify that c->remain is zero when a new
request starts.  ap_http_filter() does the wrong thing otherwise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88540 13f79535-47bb-0310-9956-ffa450edef68
2001-03-19 21:54:57 +00:00
Chuck Murcko
15e12b0c7f Stops the forced downgrade of the connection to HTTP/1.0 for proxy requests.
Submitted by:	Graham Leggett
Reviewed by:	Chuck Murcko


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88528 13f79535-47bb-0310-9956-ffa450edef68
2001-03-16 07:37:12 +00:00
Ryan Bloom
54ed3070d5 Another chunk of code from http to core. This should continue to build
on all platforms.  The next job is to shuffle functions back and forth
so that the server builds without mod_http.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88453 13f79535-47bb-0310-9956-ffa450edef68
2001-03-05 04:43:56 +00:00
Jeff Trawick
072df7960c In ap_method_in_list(), fix a typo which inadvertently cleared
l->method_list.

PR:		6980


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88433 13f79535-47bb-0310-9956-ffa450edef68
2001-03-02 22:05:39 +00:00
William A. Rowe Jr
16231360f1 Goodbye ap_send_http_header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88390 13f79535-47bb-0310-9956-ffa450edef68
2001-02-28 15:24:09 +00:00
Greg Ames
e7bc0e338f finally figured out why that word looked funny - can't spell
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88362 13f79535-47bb-0310-9956-ffa450edef68
2001-02-26 22:43:15 +00:00
Greg Ames
baf1e03541 insure that canned error msgs are translated to ascii before leaving
an ebcdic server in worst case scenarios.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88361 13f79535-47bb-0310-9956-ffa450edef68
2001-02-26 22:07:00 +00:00
Ryan Bloom
4296146043 Begin to move functions from the http module to the core. The goal is to
have only functions that are HTTP specific in the http directory.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88341 13f79535-47bb-0310-9956-ffa450edef68
2001-02-26 04:38:22 +00:00
Cliff Woolley
93fe62dd77 Simplify by using apr_bucket_delete(e) where possible.
(Oh, plus one tiny little loop simplification.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88337 13f79535-47bb-0310-9956-ffa450edef68
2001-02-25 23:08:52 +00:00
Ryan Bloom
c03d4e0715 Don't assume that the byterange filter will always be called more than
once.  It is perfectly legal to call the byterange filter one time,
with all the data.  Without this patch, that case will seg fault.
Submitted by:	Ryan Morgan <rmogran@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88320 13f79535-47bb-0310-9956-ffa450edef68
2001-02-25 16:57:08 +00:00
Bill Stoddard
298da30c6f BUFF is gone!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88266 13f79535-47bb-0310-9956-ffa450edef68
2001-02-21 21:14:33 +00:00
Roy T. Fielding
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
Doug MacEachern
c0311e3bf2 rename:
ap_bucket_create_error -> ap_bucket_error_create
ap_bucket_make_error   -> ap_bucket_error_make
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88142 13f79535-47bb-0310-9956-ffa450edef68
2001-02-13 20:24:38 +00:00
Greg Stein
dc44adee51 include "apr_signal.h" when needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88082 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 01:09:02 +00:00
Greg Stein
bb282b75f7 Clean up some of the includes:
- explicitly include apr_lib.h since ap_config.h doesn't
- use apr_want.h where possible
- use APR_HAVE_ where possible
- remove some unneeded includes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88060 13f79535-47bb-0310-9956-ffa450edef68
2001-02-10 13:05:29 +00:00
Greg Stein
f08e822471 *) minor changes, simplifications
*) fix terminate_header: don't assume anything about the brigade (especially
   that its last bucket is a shared/heap bucket)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88032 13f79535-47bb-0310-9956-ffa450edef68
2001-02-09 12:19:47 +00:00
Ryan Bloom
b3ea914127 Make the header filter use the brigade buffering functions for creating
the header string.  This allows us to clean up the header handling a bit,
because we don't need to compute the correct length before we can create
the headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88029 13f79535-47bb-0310-9956-ffa450edef68
2001-02-09 07:17:53 +00:00
Doug MacEachern
88d3406f9a renaming various functions for consistency sake
see: http://apr.apache.org/~dougm/apr_rename.pl
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88019 13f79535-47bb-0310-9956-ffa450edef68
2001-02-08 07:45:33 +00:00
Ryan Bloom
6e034c9078 We have a poor abstraction in the protocol. This is a temporary
hack to fix the bug, but it will need to be fixed for real.  If
we find an error while sending out a custom error response, we back
up to the first non-OK request and send the data.  Then, when we send
the EOS from finalize_request_protocol, we go to the last request,
to ensure that we aren't sending an EOS to a request that has already
received one.  Because the data is sent on a different request than
the EOS, the error text never gets sent down the filter stack.  This
fixes the problem by finding the last request, and sending the data
with that request.
PR:	7165


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88000 13f79535-47bb-0310-9956-ffa450edef68
2001-02-06 22:49:46 +00:00
Ryan Bloom
f11cd9f019 If we are in the middle of a brigade loop, we don't want to always check
the first bucket in the brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87986 13f79535-47bb-0310-9956-ffa450edef68
2001-02-06 04:13:45 +00:00
Ryan Bloom
deab760727 Bring mod_status for 2.0 back in line with mod_status for 1.3. This is
basically a straight port of the 1.3 module to 2.0.  The MPMs need to be
modified a bit to work with mod_status, but prefork, mpmt_pthread, and
dexter have already been changed.  I will fix perchild tonight.  There
is a lot of common code that can be abstracted, and there seems to be a
small bug with regard to what mpmt_pthread and dexter report as current
connections.  ExtendedStatus does work again, although until the bug
mentioned above is fixed, it isn't as useful on mpmt_pthread and dexter.

Next week, I will look at allowing other modules to add data to the
STATUS page and possibly to the scoreboard itself.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87949 13f79535-47bb-0310-9956-ffa450edef68
2001-02-01 21:55:16 +00:00
William A. Rowe Jr
6282d6e364 Eliminate all assumptions that finfo.protection reflects the existance
or absense of a file.  finfo.filetype is defined as 0 if APR_NOFILE,
  or a non-zero value if the file could be apr_stat()'ed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87933 13f79535-47bb-0310-9956-ffa450edef68
2001-01-31 22:45:35 +00:00
Ryan Bloom
f233072b5d Fix some byterange handling. If we get a byte range that looks like
"-999999" where that is past the end of the file, we should return
a PARTIAL CONTENT status code, and return the whole file as one big
byterange.  This matches the 1.3 handling now.  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87885 13f79535-47bb-0310-9956-ffa450edef68
2001-01-28 04:07:03 +00:00
Ryan Bloom
c8caf9a508 Use the new error bucket to report HTTP_RANGE_NOT_SATISFIABLE from
the byterange filter.  This is much safer than returning the error
directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87884 13f79535-47bb-0310-9956-ffa450edef68
2001-01-28 03:38:21 +00:00
Ryan Bloom
ae47b7ceed Fix a seg fault. The problem is easy to explain. On a HEAD request, Good
handlers will send their data down the filter stack, but 1.3 handlers will
just return, giving us a Content-Length of 0.  Since we can't send a C-L
of 0 just because it is a HEAD request, we search the headers_out table
for a 0 C-L if it is a HEAD request.  The problem is that some filters
will not allow (includes_filter) a C-L to be computed, so we end up without
a C-L header in headers_out.  Thus, when we do a strcmp against the header
value and "0", we seg fault, because the header value is NULL.

To fix this, we grab the element from the header table, and make sure it
isn't NULL before doing the strcmp.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87870 13f79535-47bb-0310-9956-ffa450edef68
2001-01-27 18:23:49 +00:00
Ryan Bloom
e4265b4294 Cleanup the error bucket code a bit. This uses the error bucket directly
instead of using ap_bucket_read.  It also lets ap_die handle the fact that
the filter returned the error.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87867 13f79535-47bb-0310-9956-ffa450edef68
2001-01-27 17:17:51 +00:00
Ryan Bloom
fd0256ed99 filters can now report an HTTP error to the server. This is done
by sending a brigade where the first bucket is an error_bucket.
This bucket is a simple bucket that stores an HTTP error and
a string.  Currently the string is not used, but it may be needed
to output an error log.  The http_header_filter will find this
bucket, and output the error text, and then return
AP_FILTER_ERROR, which informs the server that the error web page
has already been sent.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87863 13f79535-47bb-0310-9956-ffa450edef68
2001-01-27 07:13:39 +00:00
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