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
Justin Erenkrantz
b92d0b62b3 Move 100 - Continue support to the HTTP_IN filter so that filters
are guaranteed to support 100 - Continue logic without any
intervention.

This requires some reshuffling of the code in http_protocol.c so
that some static declarations are available early enough in the
code so that ap_http_filter can access them.

Note that we can not read the chunk until after (possibly) sending the
100.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94668 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 05:50:37 +00:00
Justin Erenkrantz
6f208d31a7 Adds support for reading trailers on input by exporting get_mime_headers
to ap_get_mime_headers and calling it in the appropriate place in
ap_http_filter.

showstoppers--;


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94667 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 05:43:09 +00:00
Greg Ames
d4a51d0f74 ap_send_error_response: reset r->output filters to the protocol filters.
The equivalent logic was deleted when request filters were renamed to
RESOURCE filters.  This fixes the seg faults that sometimes happen on
daedalus after a bogus 416 HTTP response is generated.

In this case, includes_filter had found an <!--#include virtual > tag, and
sent a brigade representing the data before it down the filter chain.  The
byterange filter generated the bogus 416.  ap_send_error_response essentially
starts over with a new response, but it didn't do anything to clean up the
filter chain.  So the same instance of the includes_filter got driven from the
top with the canned error text and and EOS bucket, which confused the heck
out of it.  It inserted a sentinel from the original brigade into the
error page brigade, causing problems further down the filter chain.

Submitted by:	Greg Ames, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94662 13f79535-47bb-0310-9956-ffa450edef68
2002-04-15 20:42:45 +00:00
Justin Erenkrantz
a9960ebdbb Prevent ap_add_output_filters_by_type from being called in
ap_set_content_type if the content-type hasn't changed.

Reviewed by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94368 13f79535-47bb-0310-9956-ffa450edef68
2002-04-01 22:26:09 +00:00
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Jeff Trawick
743eeb21e9 style improvement for checking whether the result of an
assignment was NULL

Submitted by:	Sander Striker


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94220 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 13:05:14 +00:00
Cliff Woolley
7a5af0ba71 Anal-retentive factor -- be consistent in our whitespace.
Reviewed by: Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94192 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 00:28:07 +00:00
Cliff Woolley
a31e5cc460 nit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94157 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 07:37:34 +00:00
Cliff Woolley
0cdeea46f3 What, we don't support HEAD requests now? ;)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94154 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 01:10:06 +00:00
Jeff Trawick
ee4a64c90a add an extra level of parentheses to say "yes I know what I'm
doing with that single '='" and more importantly to quiet a
gcc -Wall warning


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94141 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 20:37:04 +00:00
Graham Leggett
9cb9ca8e3a When a proxied site was being served, Apache was replacing
the original site Server header with it's own, which is not
allowed by RFC2616. Fixed.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94133 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 18:34:46 +00:00
Bill Stoddard
d5c24720dc Commit 1 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94056 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:41:55 +00:00
Jeff Trawick
f3c3ebe7f5 ap_rset_content_type() should take const char * instead of char *
this is friendlier to callers and r->content_type is const char *
too so it isn't harmful

this fixes a fatal compile error with AIX+xlc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94051 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 12:03:49 +00:00
Bill Stoddard
470edb9dd8 First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 01:58:47 +00:00
Greg Stein
b9514876c3 The underlying change here was to add the new WebDAV/DeltaV methods
now that it has an RFC. At the same time, I revamped a good chunk of
the name <-> number mapping code in http_protocol.c

* add M_FOO constants for the new RFC 3253 (DeltaV) methods. label
  where each of the builtin methods comes from.

* moved METHOD_NUMBER_FIRST/LAST from http_protocol.h into
  http_protocol.c since they weren't used anywhere else and they
  weren't namespace-protected.

* create register_one_method() and use it to insert all builtin
  methods (at _init() time) and extended methods into the registry.

* add a lookup_builtin_method() to quickly map a method name to a
  builtin method number.

* rebuild ap_method_number_of() to use the new lookup function.

* revamp ap_method_name_of() to use the registry to locate the name
  for any method number. add a pool argument (no callers in the core
  code needed to be updated)

* revamp make_allow() to deal with the new method numbers and all
  extended methods.

* in mod_dav, use the new method numbers rather than registering the
  DeltaV methods.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94015 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 10:11:33 +00:00
Jeff Trawick
0bd9790c41 fix the type of a string argument to ap_log_error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93973 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 20:29:38 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Ryan Bloom
c8965c1e94 Adding the same filters over and over again used to be okay, because
we would lose the extra filters.  Now, if a filter is added, it is run.
Unfortunately, this can cause an infinite loop, or it can cause request
headers to appear twice.  This commit removes two instances in the core
where we were inserting filters for a second and third time.  The bug
was that error responses were causing infinite loops.

This also removes the reset_filters function, which did the exact
same thing as add_required_filters.  The two functions were both called
in error conditions, which was part of what caused this bug.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93693 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 05:54:44 +00:00
Justin Erenkrantz
04533b8d27 Don't set bytes_sent to be 0 when r->assbackwards since this screws up
logging.

The content length filter seems to track bytes_sent properly regardless
of HTTP version.  The HTTP header filter knows not to send C-L (or any
headers) to this client.

showstoppers--;

(Also fix typo of my last name in CHANGES...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93588 13f79535-47bb-0310-9956-ffa450edef68
2002-02-27 03:55:31 +00:00
Justin Erenkrantz
1ed7a6d590 Oh, no. It's legal to have 0 bytes read. Just not -1. If *that* happens,
I want to see a core.  0 bytes reads are fine.  Grr.

(I'm so tempted to throw this assert out, but if we get -1 length
brigades back, we're gonna be screwed.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93202 13f79535-47bb-0310-9956-ffa450edef68
2002-02-03 17:43:35 +00:00
Justin Erenkrantz
94d01b65aa Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length.  This is
much more consistent.  Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length.  This makes it now possible to
pass constants down without assigning them to a temporary variable first.

Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
  some circumstances


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93014 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:11:47 +00:00
Justin Erenkrantz
cf16de9220 When doing input filtering, get out the way of anything that we don't want
to be explicitly involved in.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92946 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 18:53:31 +00:00
Justin Erenkrantz
7d32242a14 Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.

We also no longer look at readbytes to determine the method of
filter operation.  This makes the use of filters more obvious and
allows a wider range of options for input filters modes.

To start with, the new input filter modes are:

AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)

The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ

This also allows cleanup of mod_ssl's handling in the getline case.

Reviewed by:	Ryan Bloom (concept), Greg Stein (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92928 13f79535-47bb-0310-9956-ffa450edef68
2002-01-19 07:45:18 +00:00
Bill Stoddard
e4494ea98a Log a more descriptive error message.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92851 13f79535-47bb-0310-9956-ffa450edef68
2002-01-14 14:44:25 +00:00
Ken Coar
0d1a46028e Bring forward the FileETag directive enhancement from 1.3.23-dev.
(Passes all 61 of the apache/etags.t test.)  Bump MMN due to
	change to core_dir_config structure (new fields at end).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92830 13f79535-47bb-0310-9956-ffa450edef68
2002-01-11 18:55:27 +00:00
Greg Stein
e312a3c306 Fix how mod_dav examines methods in the request -- use the method number
from the request. To do this, we also need to register all of the new/custom
methods that mod_dav recognizes.

Note: this fixes a bug where a method (e.g. REPORT) would appear in a
Limit(Except) directive and Apache would register the method. The method
number in the request would then be something *other* than M_INVALID, which
threw off mod_dav's tests.

Submitted by: Sander Striker <striker@apache.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92764 13f79535-47bb-0310-9956-ffa450edef68
2002-01-07 22:36:15 +00:00
Bill Stoddard
59550522ce Fix seg fault in HTTP_IN when trying to handle the LimitRequestBody
directive when reading a proxy response. We should bypass LimitRequestBody
activities when handling a response from the proxied server.

I don't think this will circumvent requestbody checking on a large request
coming into the server that is destined to be proxied. (not tested though).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92722 13f79535-47bb-0310-9956-ffa450edef68
2002-01-03 19:20:54 +00:00
Justin Erenkrantz
8c16aeeeb8 Fix LimitRequestBody directive by moving the relevant code from
ap_*_client_block to ap_http_filter (aka HTTP_IN).  This is the
only appropriate place for limit checking to occur (otherwise,
chunked input is not correctly limited).

Also changed the type of limit_req_body to apr_off_t to match the
other types inside of HTTP_IN.  Also made the strtol call for
limit_req_body a bit more robust.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92700 13f79535-47bb-0310-9956-ffa450edef68
2002-01-02 07:56:25 +00:00
Brian Pane
c98d16f329 Small performance fix: delay variable initialization in
ap_meets_conditions() until after the point where we
short-circuit out of the function on subrequests


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92354 13f79535-47bb-0310-9956-ffa450edef68
2001-12-06 02:57:19 +00:00
Brian Pane
2f38fa60c8 optimized away the sprintf calls in ap_make_etag()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92161 13f79535-47bb-0310-9956-ffa450edef68
2001-11-24 07:38:52 +00:00
Brian Pane
db91d6cf85 added inlined string concatenation to form_header_field() for speed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92137 13f79535-47bb-0310-9956-ffa450edef68
2001-11-22 21:04:28 +00:00
Justin Erenkrantz
0506ac2b0a Clean up the declarations and comments of some of the variables in
ap_get_client_block.
There were two len_read vars (each of different types), so the outer one
was shadowed - move it to the correct scope.
Move apr_bucket* old declaration inside of the loop so it is obvious
what its scope is.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91806 13f79535-47bb-0310-9956-ffa450edef68
2001-11-08 19:35:32 +00:00
Justin Erenkrantz
7f3dac3d26 Style guide conformance fixes (remove tabs, enforce {}s, no long lines, etc).
This file has bugged me for ages.  Much better to do this now than later.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91805 13f79535-47bb-0310-9956-ffa450edef68
2001-11-08 19:27:48 +00:00
Ken Coar
b12bfcff03 No functional changes, just style-guide ones..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91802 13f79535-47bb-0310-9956-ffa450edef68
2001-11-08 15:13:49 +00:00
Greg Ames
272e6e0c4b Insure that ap_get_client_block _always_ sets the length parm positive when
calling ap_get_brigade.  This takes care of the loop with short request bodies
seen on 2.0.27.

This eliminates the use of r->remaining within ap_get_client_block.
http_filter has the equivalent in its context.  r->remaining is
still used in ap_setup_client_block for a "body too long" check.  But that
check can't cover chunked bodies, so it probably should happen elsewhere.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91785 13f79535-47bb-0310-9956-ffa450edef68
2001-11-07 15:41:43 +00:00
Greg Ames
474e1926bb prevent loops & seg faults when GETs have chunked bodies.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91734 13f79535-47bb-0310-9956-ffa450edef68
2001-11-02 20:21:44 +00:00
Aaron Bannert
bb447fc0c5 Cautiously avoiding the scoping issue that was discussed on the list,
I thought these other changes needed to go in; Namely that we don't
need to check if the brigade is empty twice in the loop, just once.
Added a comment for good measure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91478 13f79535-47bb-0310-9956-ffa450edef68
2001-10-16 01:04:08 +00:00
Justin Erenkrantz
d55c3c855b Ensure that ap_http_filter can not be coersced into reading more than we
think is currently available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91462 13f79535-47bb-0310-9956-ffa450edef68
2001-10-14 20:38:04 +00:00
Ryan Bloom
0385ad938a Remove some warnings from the code. The buckets take a different
type for the length than the brigade functions do.  This moves the
len_read variable into the correct scope for the two times that it
is used, and defines it correctly for each scope.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91417 13f79535-47bb-0310-9956-ffa450edef68
2001-10-11 04:40:14 +00:00
Justin Erenkrantz
5c26e8775c We can't pass in &r->remaining because we change that value on output to
be how many bytes we read.  This trounces on the r->remaining value, so
we must use a local variable and subtract that from r->remaining after we
read.
Reviewed by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91413 13f79535-47bb-0310-9956-ffa450edef68
2001-10-11 01:40:32 +00:00
Greg Stein
173d083ed0 HTTP_IN was attempting to process the PEEK mode. This threw off
check_pipeline_flush(), making it think another request was available (when
it wasn't). Apache would avoid flushing the prior request and block on
reading the next request. (of course, the client wasn't sending the next
one, cuz it was still waiting for the results of the first one)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91366 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 20:12:50 +00:00
William A. Rowe Jr
73fcb0b7af Goodbye r->content_lanaguage (per vote from apache-1.3/STATUS).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91244 13f79535-47bb-0310-9956-ffa450edef68
2001-10-02 21:13:42 +00:00
William A. Rowe Jr
8b54a808a9 Remain consistent to the connection_rec, and use apr_off_t for remaining.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91216 13f79535-47bb-0310-9956-ffa450edef68
2001-10-01 15:48:15 +00:00
Justin Erenkrantz
9846f649bf Switch to the corresponding apr_table_* macro rather than doing this
ourselves.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91207 13f79535-47bb-0310-9956-ffa450edef68
2001-09-30 01:37:20 +00:00
Justin Erenkrantz
0706716dbb Cleanup some needless initialization of the date variable and consolidate
the scope to only where necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91206 13f79535-47bb-0310-9956-ffa450edef68
2001-09-30 01:17:13 +00:00
Justin Erenkrantz
66ee5533d3 Remove the lameo create_req hack and delay the addition of the HTTP_IN
filter until after we have read the headers.  This eliminates the status
hack that was in http_protocol.c and makes it all around better.

server/protocol.c now directly adds HTTP_IN filter - should we create a
specific hook for this?  (Could we do this as a post_read_request hook?)
I'm not terribly sure, but let's move it down to the lowest possible
place in ap_read_request.  We can change this detail later as we see fit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91192 13f79535-47bb-0310-9956-ffa450edef68
2001-09-29 08:48:59 +00:00
Justin Erenkrantz
fa9432b44a Remove bogus comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91190 13f79535-47bb-0310-9956-ffa450edef68
2001-09-29 08:29:18 +00:00
Justin Erenkrantz
08eb7609da Input filtering rewrite. Consolidate how we handle HTTP input parsing by
rearranging and rethinking some things.  The net result is that the HTTP
filter is now a request filter and is now only responsible for HTTP things.
The core input filter is now responsible for handling all of the dirty work.

Highlights:
- Removes the dechunk filter and merges it with ap_http_filter (aka HTTP_IN).
  The dechunk filter was incorrectly handling certain cases (trailers).
- Moves ap_http_filter from a connection filter to a request filter
  to support the consolidation above (it needs header info).
- Change support code to allow the http_filter to be a
  request filter (how the request is setup initially).
- Move most of the logic from HTTP_IN to CORE_IN (core_input_filter).
  HTTP_IN is now only concerned about HTTP things.  The core filter
  is now responsible for returning data.  It is impossible to
  consolidate dechunk and http without this because HTTP_IN previously
  buffered data.  As Greg has suggested, it may make sense to write
  some brigade functions that handle input (getline).  It should be
  fairly trivial to add these.  Some of the calls in ap_http_filter
  could be switched as well.

This is the original patch as submitted to dev@httpd on Monday, Sep.
24th.  Additional comments and some minor tweaks done after that
submission are coming up next.  This should allow people who reviewed
the original patch to see what has changed and review them piecemeal.

This test passes all current tests in httpd-test.  Please perform
chicken sacrifices to verify that this hasn't blown up your favorite
input.

Reviewed by:	Greg Stein, Ryan Bloom, and Cliff Woolley (buckets)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91189 13f79535-47bb-0310-9956-ffa450edef68
2001-09-29 08:17:11 +00:00
Greg Stein
0d93863aa4 Temporary hack to ensure that the split results are within a brigade
attached to the proper pool. Otherwise, ctx->b would end up associated with
the request pool, and the SOCKET bucket from the CORE_IN filter would get
cleared at request end (thus the next request would go to CORE_IN for more
data and get APR_EOF, and figured there were no more requests).

This section of code was only triggered when a request had a body. The
symptom was closing the connection (even though it should have been a
keepalive) after the response was sent.

For more info, see Message-ID on dev@: <20010917061613.B466@lyra.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91053 13f79535-47bb-0310-9956-ffa450edef68
2001-09-17 13:12:37 +00:00
Ryan Bloom
57b309fdd1 Fix logging of bytes sent for HEAD requests. %b and %B should
log either - or 0, before this patch, they were both logging
the file size.

PR:	8021
Submitted by:	Taketo Kabe <kabe@sra-tohoku.co.jp>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90870 13f79535-47bb-0310-9956-ffa450edef68
2001-09-02 03:21:47 +00:00