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
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
Doug MacEachern
46a6922999 backing out the ap_set_keepalive uncheck for Content-Length header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90707 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 20:09:52 +00:00
Doug MacEachern
1a461cd85c ap_content_length_filter has already set Content-Length
before ap_set_keepalive is called.  need to remove this check
in order for keepalives to work.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90700 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 18:57:16 +00:00
William A. Rowe Jr
d9dee61f75 Readded "downgrade-1.0" which I (inadvertantly) pulled with the
map_to_storage patch.  I knew it had to have a better home, and
  it sure looks like this is it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90683 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 04:59:37 +00:00
William A. Rowe Jr
307ab55886 Introduce the map_to_storage hook, which allows modules to bypass
the directory_walk and file_walk for non-file requests.  TRACE
  shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
  directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.

  A seperate patch to mod_proxy is required to short circuit both the
  TRACE and directory_walk/file_walk stuff.  That patch is next.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90665 13f79535-47bb-0310-9956-ffa450edef68
2001-08-25 23:43:19 +00:00
Cliff Woolley
95a67f5150 Just a little extra commentary...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90649 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 20:38:27 +00:00
Cliff Woolley
64dd7641e7 Fix a double-free condition when byterange requests are made on brigades
containing any bucket that cannot be copied natively (ie, pipe or socket
buckets).

Before, we were reading that bucket to morph it to a heap bucket and then
taking the str that heap bucket points to and placing it in a second,
completely separate heap bucket.  That means we'd have two apr_bucket/
apr_bucket_heap pairs each with a refcount of 1 (rather than two apr_buckets
and a single apr_bucket_heap with a refcount of 2).  str would then be
doubly-freed when the second of those two buckets was destroyed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90648 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 20:27:40 +00:00
Doug MacEachern
d79cea3d70 enable ssl Translate, UserCheck, Access and Auth hooks
add support for renegotiation during the Access hook
this requires hooking into the read and write SSL BIOs in order to
flush data to the client and read from the filter chain

this also requires that the ssl filters become "aware" that
renegotitation is in progress so that the BIOs are left alone for
SSL_renegotiate/SSL_do_handshake in ssl_hook_Access to deal with

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90185 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 03:58:16 +00:00
Ryan Bloom
6e932b2870 Fix the new method code. We need to cast 1 to an apr_int64_t or it will
be treated as a 32-bit integer, and it will wrap after being shifted
32 times.
Submitted by:	Cody Sherr <csherr@covalent.net> and
		Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90090 13f79535-47bb-0310-9956-ffa450edef68
2001-08-11 04:04:13 +00:00
Ryan Bloom
a2cab6eda2 This should fix the remaining problems with POST. Basically, we
add a new macro, called APR_BRIGADE_NORMALIZE.  This macro searches
all the buckets, and removes any zero length bucket.  They we can
just use APR_BRIGADE_EMPTY to determine if our brigade has any data,
and we can quickly call ap_get_brigade if it doesn't.

Doug, please throw your battery of tests at this to make sure it works.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90070 13f79535-47bb-0310-9956-ffa450edef68
2001-08-10 18:35:08 +00:00
Ryan Bloom
4b239f39d3 If we are going to get the length of a brigade, it helps if that
brigade has data.  To that end, if we have just expanded ctx->b, we need
to concat ctx->b to the end of b, so that b has something to pass
back to the previous filter.

This fixes the problem with the proxy not proxying non-keepalive
connections.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90046 13f79535-47bb-0310-9956-ffa450edef68
2001-08-09 04:56:23 +00:00
Ryan Bloom
9d615b23da Add a comment so that the next poor fool who re-writes this section
of code will know about this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90045 13f79535-47bb-0310-9956-ffa450edef68
2001-08-09 04:25:46 +00:00
Ryan Bloom
979df5fa53 Handle the -1 case in ap_http_filter. -1 means that we have to read
all data from the socket until the socket is closed.  This has been
used to proxy www.google.com successfully, but it doesn't return anything
when used with www.yahoo.com.  Still debugging that problem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90044 13f79535-47bb-0310-9956-ffa450edef68
2001-08-09 04:21:26 +00:00
Ryan Bloom
6513c027a7 Remove the block argument from apr_brigade_partition. This looked good
in theory, but in reality, we should just rely on the timeouts to handle
this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90043 13f79535-47bb-0310-9956-ffa450edef68
2001-08-08 22:24:04 +00:00
Ryan Bloom
0e959b94c7 Re-apply the patch from yesterday that makes ap_http_filter use
apr_brigade_partition.  In order to do this cleanly, I had to make
some changes to the apr_brigade_partition API, so this also adds fixes
all of the calls to that function throughout the server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90029 13f79535-47bb-0310-9956-ffa450edef68
2001-08-08 15:42:08 +00:00
Doug MacEachern
3712a19778 this change breaks POST, backing out for the moment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90003 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 19:54:06 +00:00
William A. Rowe Jr
cd6a44feef Must return something in the 2^32 domain (preferably one, as shown here),
not in the 2^64 domain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89998 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 18:37:04 +00:00
Ryan Bloom
9fc8386d20 Greatly simplify the ap_http_filter logic, by using the
apr_brigade_partition function.  This should also remove a warning from
the Windows build, because apr_off_t and apr_size_t aren't the same
size.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89997 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 17:57:44 +00:00
William A. Rowe Jr
58c8930a02 Just cleaning up some indents
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89991 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:40:29 +00:00
Ryan Bloom
cf2e6a1831 Remove all warnings from the input filtering stack.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89987 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:19:03 +00:00
William A. Rowe Jr
0b6c2c7005 Make this legible. Points out a huge headache in the new conftree pools
mechanism, that we aren't joined properly, so we hit the 'not ancestor'
  abend here.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89880 13f79535-47bb-0310-9956-ffa450edef68
2001-08-02 19:37:46 +00:00
Ryan Bloom
85e8fbd0e2 Add the ability to extend the methods that Apache understands
and have those methods <limit>able in the httpd.conf. It uses
the same bit mask/shifted offset as the original HTTP methods
such as M_GET or M_POST, but expands the total bits from an int to
an ap_int64_t to handle more bits for new request methods than
an int provides.
Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89869 13f79535-47bb-0310-9956-ffa450edef68
2001-08-02 04:25:20 +00:00
William A. Rowe Jr
3db17f7926 Restore to 1.333 state (problematic, in that we could be facing >(size_t)
bytes, but better till I figure out the _right_ fix.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89853 13f79535-47bb-0310-9956-ffa450edef68
2001-08-01 04:08:36 +00:00
William A. Rowe Jr
8ae10a2a98 A bit of Saturday a.m. XHTML Transitional 1.0 compatibility changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89779 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 04:19:57 +00:00
William A. Rowe Jr
bb2fc524c9 Final pedantic HTML 3.2/4.01 Transitional + XHTML 1.0 Transitional
compliance changes.  Note I've left alone the <P> tags, since they
  are abused, misused, potentially unsalvageable and certainly more
  effort than I care to expend in my quest for brainless end of week
  keyboard exercise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89753 13f79535-47bb-0310-9956-ffa450edef68
2001-07-28 01:29:41 +00:00
Cliff Woolley
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
William A. Rowe Jr
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
William A. Rowe Jr
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
William A. Rowe Jr
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