Commit Graph

536 Commits

Author SHA1 Message Date
de7d0daac0 Fix printf() warnings related to long->apr_off_t swap
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89738 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 18:40:27 +00:00
3e6771f3d3 Something that needs looking at, all our long (unsigned long) body
lengths need to become apr_off_t.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89732 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 17:12:29 +00:00
cac7abfbb5 This patch should address input buffering, requesting only as much from
the client as the ap_get_client_block() buffer is prepared to accept.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89728 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 16:05:36 +00:00
5b71e358f3 Change the length of the content args to apr_off_t identifiers, and fix
mod_negotation to treat a size of -1 and indeterminate, instead of 0.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89727 13f79535-47bb-0310-9956-ffa450edef68
2001-07-26 15:53:15 +00:00
7b2c62a74e Changes to respect the new apr bucket and brigade length types (either
apr_size_t for bucket lengths, or apr_off_t for aggregate brigade lengths.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89683 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 20:38:01 +00:00
de06ddf627 Fix problem with the previous patch to handle HEAD requests. Now, the
header_filter will stay installed in the filter chain when processing
HEAD requests to intercept and discard content bodys sent by poorly
written handlers. This work also points out the need for an optimization
in the content_length filter to not split the brigade if the next bucket
in the brigade is an EOS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89679 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 17:24:05 +00:00
204e7c5e42 Fix problem reported by Taketo Kabe <kabe@sra-tohoku.co.jp>
where HEAD response headers were being repeated twice for
files greater than 32K bytes (4*AP_MIN_BYTES_TO_WRITE). This
problem in the http_header filter was exposed by the recent rewrite
of the content_length filter.
[Taketo Kabe, Bill Stoddard]

PR: 8037


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89676 13f79535-47bb-0310-9956-ffa450edef68
2001-07-24 14:36:29 +00:00
1a44af4868 only reset request level filters in reset_filters(), else for example
TLSFilter gets wiped out, breaking any response that comes through ap_die
(including the frequent '304 not modified')
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89601 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 19:52:40 +00:00
c721f48845 Avoid redundant strlen() calls by using apr_brigade_write() instead of
apr_brigade_puts().  There is still some redundancy--it'd be ideal if there
were an apr_pstrcat() variant that returned the length of the string since
it computes it (twice) anyway so we didn't have to do it yet again.  Until
such a beast exists, computing the length three times is better than four.
:-/


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89516 13f79535-47bb-0310-9956-ffa450edef68
2001-07-08 06:24:55 +00:00
bb2ac7e982 s/cont/pool/
This gets us building again after the change in APR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89510 13f79535-47bb-0310-9956-ffa450edef68
2001-07-07 16:20:45 +00:00
c091130eab * apr_brigade_partition() now returns an apr_status_t (finally!).
* did some code cleanups/optimizations in that function.
* updated Apache's byterange filter to handle the new prototype. added
  error handling to the byterange filter should apr_brigade_partition()
  ever fail, which it never will unless somebody either removes the earlier
  call to apr_brigade_length() for some unknown reason or invents a new
  bucket type that is of a predetermined length but which cannot be split
  natively (or which has a split that might fail).  might as well be
  future-proof.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89363 13f79535-47bb-0310-9956-ffa450edef68
2001-06-13 16:48:37 +00:00
66a61c359d Add a pool to the ap_save_brigade prototype. This removes a todo from
the comments that is really necessary before the setaside stuff will
work properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89362 13f79535-47bb-0310-9956-ffa450edef68
2001-06-13 13:44:40 +00:00
e1464feb18 use apr-util's apr_date_parse_http() instead of the to-be-removed
ap_parseHTTPdate()

(proxy needs to make similar changes)

build changes forthcoming...

Submitted by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89277 13f79535-47bb-0310-9956-ffa450edef68
2001-06-06 19:30:54 +00:00
2abe50dc9a Fix the reset_filters function. If we set r->output_filters to NULL,
then we also have to reset the connection's filters.
Submitted by:	John Sterling <sterling@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89269 13f79535-47bb-0310-9956-ffa450edef68
2001-06-04 21:43:08 +00:00
a10b0be85c Optimise reset_filter() in http_protocol.c
PR:
Obtained from:
Submitted by:	Greg Stein
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89256 13f79535-47bb-0310-9956-ffa450edef68
2001-06-01 22:14:01 +00:00
551ecb9a9a Fix processing of the TRACE method. Previously we passed bogus
parms to form_header_field() and it overlaid some vhost structures,
resulting in a segfault in check_hostalias().
[Greg Ames, Jeff Trawick]

Note: Not being familiar with the TRACE method I compared the 2.0
output with 1.3.9 output.  The only difference is that with 2.0 we
get a Content-Length header field.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89138 13f79535-47bb-0310-9956-ffa450edef68
2001-05-17 18:04:18 +00:00
86154b12b2 Add the AP_DECLARE()/AP_CORE_DECLARE macros on the return types of
functions used by mod_proxy for export in DLL
Submitted by:	Ian Holsman <IanH@cnet.com>
Reviewed by:	Chuck murcko


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89078 13f79535-47bb-0310-9956-ffa450edef68
2001-05-11 04:35:41 +00:00
1c98aabbf1 Back out the recent change to ap_get_brigade, to make it use indirection
again.  The problem is that the amount of data read from the network,
is not necessarily the amount of data returned from the filters.  It is
possible for input filters to add bytes to the data read from the network.

To fix the original bug, I just removed the line from ap_get_client_block
that decremented r->remaining, we allow the http_filter to do that for
us.

I have also removed an incorrect comment.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89041 13f79535-47bb-0310-9956-ffa450edef68
2001-05-06 23:27:14 +00:00
5cba6d7345 Fix a bug in the input handling. ap_http_filter() was modifying *readbytes
which corresponded to r->remaining (in ap_get_client_block). However,
ap_get_client_block was *also* adjusting r->remaining. Net result was that
PUT (and probably POST) was broken. (at least on large inputs)

To fix it, I simply removed the indirection on "readbytes" for input
filters. There is no reason for them to return data (the brigade length is
the return length). This also simplifies a number of calls where people
needed to do &zero just to pass zero.

I also added a number of comments about operations and where things could be
improved, or are (semi) broken.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89008 13f79535-47bb-0310-9956-ffa450edef68
2001-05-05 11:18:01 +00:00
eb94b557ee At the hack-athon we decided to change the way that input filters
determine how much data is returned to the previous filter.  Prior to this
change, we used a field in the conn_rec to determine how much to return.
After this change, we use an argument to ap_get_brigade.  This makes it
much more obvious how things work at all levels, so that module authors
can easily determine how much data is supposed to be returned to them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88912 13f79535-47bb-0310-9956-ffa450edef68
2001-04-22 22:19:32 +00:00
97b23cb074 Add a comment about how http_filter works.
Submitted by:	Graham Leggett <minfrin@sharp.fm>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88911 13f79535-47bb-0310-9956-ffa450edef68
2001-04-22 15:46:19 +00:00
4647e5f71a Revert the change that moved keepalives out of conn_rec. That variable
controls the number of requests per connection, regardless of the protocol
used by the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88908 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 12:23:37 +00:00
70a67b2c26 Move the keepalives field out of the conn_rec and into an HTTP specific
connection record.  This also moves some HTTP specific back out of the
core and into the HTTP module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88881 13f79535-47bb-0310-9956-ffa450edef68
2001-04-18 03:53:34 +00:00
a7bc1f3efa If a higher-level filter handles the the byterange aspects of a
request, then the byterange filter should not try to redo the
work.  The most common case of this happening, is a byterange
request going through the proxy, and the origin server handles
the byterange request.  The proxy should ignore it.

Submitted by:	Graham Leggett <minfrin@sharp.fm>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88873 13f79535-47bb-0310-9956-ffa450edef68
2001-04-16 21:16:53 +00:00
3cba58c98f When I initially pulled the BYTERANGE filter into the core, Greg Stein
told me I was wrong.  I was wrong, and Greg was right.  This commit
just moves the byterange filter and its related functions out of the core,
and puts them back in the HTTP specific module.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88815 13f79535-47bb-0310-9956-ffa450edef68
2001-04-11 23:37:16 +00:00
11d8cc5a58 Fix the OPTIONS response. It was attempting to send an HTTP response
(header) through the filter stack, which just wrapped that response in
another set of headers.

Instead, just set the Allow header and return. The EOS will then flush that
header with the rest of the data through the header filter, and generate the
proper response.

Also, cleaned out the unused header_filter_ctx and the "len" variable from
the header filter, and added some comments here and there.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88600 13f79535-47bb-0310-9956-ffa450edef68
2001-03-28 10:40:44 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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