1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

383 Commits

Author SHA1 Message Date
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
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
Greg Ames
13a3c248cc Provide vhost and abbreviated request strings on ExtendedStatus displays.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89541 13f79535-47bb-0310-9956-ffa450edef68
2001-07-12 02:19:41 +00:00
Bill Stoddard
040c05592a Fix problem handling FLUSH bucket in the chunked encoding filter.
Module was calling ap_rwrite() followed by ap_rflush() but the
served content was not being displayed in the browser. Inspection
of the output stream revealed that the first data chunk was
missing the trailing CRLF required by the RFC


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89422 13f79535-47bb-0310-9956-ffa450edef68
2001-06-26 17:40:58 +00:00
Jeff Trawick
0094a39006 don't add BYTERANGE, CONTENT_LENGTH, or HTTP_HEADER for
subrequests; they only make sense for main requests and
internal redirects


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89283 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 01:14:24 +00:00
Graham Leggett
1fe44dacde Move the addition of default AP_HTTP_HTTP_HEADER filters to the
insert_filter phase so that other filters are not bypassed by default.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89252 13f79535-47bb-0310-9956-ffa450edef68
2001-06-01 17:26:19 +00:00
Doug MacEachern
654a74cbae back out filter change that is preventing headers to be sent
PR:
Obtained from:
Submitted by: john sterling
Reviewed by:	dougm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89239 13f79535-47bb-0310-9956-ffa450edef68
2001-05-30 05:18:33 +00:00
Graham Leggett
3fdc9ca62a Move the addition of default AP_HTTP_HTTP_HEADER filters to the insert_filter
phase so that other filters are not bypassed by default.
PR:
Obtained from:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89196 13f79535-47bb-0310-9956-ffa450edef68
2001-05-21 23:47:21 +00:00
Ken Coar
da47986440 Fix function type to match hook declaration.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89164 13f79535-47bb-0310-9956-ffa450edef68
2001-05-19 17:08:33 +00:00
Roy T. Fielding
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
Roy T. Fielding
779fc6bb31 Revert addition of HTTP logging hhok for connection status -- this is not
specific to HTTP.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88907 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 12:00:02 +00:00
Ryan Bloom
dadd829c60 Allow modules to specify their own logging format specifier. Basically,
mod_log_config has registered an optional function, that other modules
can use to specify a function to be called.  This is analogous to the way
that mod_include works.  This also allows http to do the connection
logging itself, without exposing HTTP specific pieces to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88888 13f79535-47bb-0310-9956-ffa450edef68
2001-04-18 21:06:07 +00:00
Ryan Bloom
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
Ryan Bloom
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
Jeff Trawick
1545559270 make sure we have the prototype for strcasecmp()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88593 13f79535-47bb-0310-9956-ffa450edef68
2001-03-27 11:47:23 +00:00
Ryan Bloom
3eeeb76fb4 Move more code from the http module into the core server. This
is core code, basically the default handler, the default input
and output filters, and all of the core configuration directives.
All of this code is required in order for the server to work, with or
without HTTP.  The server is closer to working without the HTTP
module, although there is still more to do.

I tried to fix Windows, but somebody should probably make sure I did
it correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88449 13f79535-47bb-0310-9956-ffa450edef68
2001-03-04 06:27:27 +00:00
Greg Stein
4be8260f87 core_pre_config isn't needed
Submitted by: Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88384 13f79535-47bb-0310-9956-ffa450edef68
2001-02-28 07:43:12 +00:00
Cliff Woolley
759657fd4c Remove references to apr_bucket_init_types() and
apr_bucket_insert_type().  I imagine that core_pre_config() could
go away completely, but I'll leave that to someone who knows
more about hooks than I do.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88381 13f79535-47bb-0310-9956-ffa450edef68
2001-02-28 04:48:44 +00:00
Cliff Woolley
fa49b7942b Update to reflect the absence of the apr_bucket_shared
struct and the newly-added start field of the apr_bucket struct


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88372 13f79535-47bb-0310-9956-ffa450edef68
2001-02-27 21:02:15 +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
Greg Stein
ee3fe477e3 *) fix inline handling. we had: apr_inline, APR_INLINE, USE_GNU_INLINE, and
INLINE. Now, we just have APR_INLINE and APR_HAS_INLINE.
   - convert all usage
   - note that apr_general messed up the defn (compared to apr.h)
   - simplify the inline decision logic in os/*/os.h
   - simplify the code in os/*/os-inline.c

*) toss ap_checkconv() [no longer used]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88298 13f79535-47bb-0310-9956-ffa450edef68
2001-02-24 11:23:31 +00:00
Greg Stein
e78825ca70 - more ap_conf_vector_t fixup.
- break out the cmd_parms to ap_set_config_vectors to clarify/doc what is
  happening in there and because the function operates independent of cmds.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88227 13f79535-47bb-0310-9956-ffa450edef68
2001-02-18 04:26:13 +00:00
Greg Stein
dd9b08e321 *) Introduce "ap_conf_vector_t" type to assist with legibility and provide
some type safety. (unfortunately, our old "void*" is type-safe with the
   new one, but over time we should be better)

*) Propagate the new type to all appropriate functions.

*) Random cleaning, whitespace, stylistic nits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88225 13f79535-47bb-0310-9956-ffa450edef68
2001-02-18 02:58:53 +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
Ryan Bloom
78821bbf21 Remove the coalesce filter. With the addition of the ap_f* functions,
this filter is no longer necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88178 13f79535-47bb-0310-9956-ffa450edef68
2001-02-15 23:07:42 +00:00
Ryan Bloom
69f1ea01a9 Fix a warning when compiling with GPROF
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88076 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 00:10:30 +00:00
Greg Stein
5dc34feb12 *) continued header revamping
*) torch some headers (and some libs) from the autoconf stuff


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88061 13f79535-47bb-0310-9956-ffa450edef68
2001-02-10 14:04:21 +00:00
Ryan Bloom
0ed6a0d15c Change AddInputFilter and AddOutputFilter to SetInputFilter and
SetOutputFilter.  This corresponds nicely with the other Set
directives, which operate on containers while the Add* directives
tend to work directly on extensions.  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88042 13f79535-47bb-0310-9956-ffa450edef68
2001-02-10 00:33:38 +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
Bill Stoddard
1a3c98e63b Tweak the AP_MIN_SENDFILE_BYTES. Not using sendfile on Windows
in the general (non byterange) case is a HUGE performance hit (> 50% in many cases).
I also suspect most byterange requests will be for substantially more bytes (a pageful
out of a larger document for example). In the uncommon (I believe) cases where
fewer bytes are requested, 250 bytes per packet is not too abusive of the network.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87983 13f79535-47bb-0310-9956-ffa450edef68
2001-02-05 18:28:47 +00:00
Jeff Trawick
2407c615d0 avoid warning in non-AP_DEBUG build
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87957 13f79535-47bb-0310-9956-ffa450edef68
2001-02-02 18:15:42 +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
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
Bill Stoddard
823e2e2bb2 Add the coalesce filter back in. It is NOT being installed anywhere right now.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87825 13f79535-47bb-0310-9956-ffa450edef68
2001-01-25 02:51:30 +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
Jeff Trawick
6a27a17c55 get http_core to compile on systems without apr_sendfile() support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87815 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 16:10:02 +00:00
Greg Stein
f95929d4b3 A single outermost loop is all that is needed. Simplify and add comments
about what is going on in there. Shift some declarations to scope their
usage and (re)initialize them on each pass over the brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87811 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 06:17:26 +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
Ryan Bloom
67ce413122 Loop over the brigade when multiple buckets file are found, instead of
breaking out of the function.
Submitted by:   Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87805 13f79535-47bb-0310-9956-ffa450edef68
2001-01-24 01:38:31 +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
5de7834338 Allow the core_output_filter to deal with multiple file buckets in the
same brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87801 13f79535-47bb-0310-9956-ffa450edef68
2001-01-23 23:23:37 +00:00
Ryan Bloom
24ad26fca5 Fix the core_output_filter. It doesn't make any sense to send less than
8K of a file using sendfile, it is easier to just read strings from the
file and use those strings directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87800 13f79535-47bb-0310-9956-ffa450edef68
2001-01-23 23:05:12 +00:00
Ryan Bloom
32897f5a9f Fix the core to take the new file bucket type into account.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87794 13f79535-47bb-0310-9956-ffa450edef68
2001-01-23 07:31:09 +00:00
Ryan Bloom
b825ae06ca Remove AddModule and ClearModuleList. Neither directive really makes
much sense anymore, since we use the hooks to order modules correctly.
This also removes the possability that one module will ever register the
same function for the same hook twice.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87784 13f79535-47bb-0310-9956-ffa450edef68
2001-01-21 22:14:16 +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
William A. Rowe Jr
de65e8cd0e Provide apr_pool_t arg to register_hooks, since anything they do in that
step -must- be done with a pool that will not outlive the cmd pool, from
  which they may have been dynamically loaded.

  This needs further review, it's committed only as a stopgap for those
  who's builds I broke, sorry.  Review tbc late this evening.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87699 13f79535-47bb-0310-9956-ffa450edef68
2001-01-17 22:04:45 +00:00
William A. Rowe Jr
40655f8641 Provide apr_pool_t arg to register_hooks, since anything they do in that
step -must- be done with a pool that will not outlive the cmd pool, from
  which they may have been dynamically loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87697 13f79535-47bb-0310-9956-ffa450edef68
2001-01-17 15:52:12 +00:00
Doug MacEachern
40391fb9f2 adjust remaining modules to use the new handler hook method (Alan Edwards)
bring back the old handler prototype by reusing r->handler (dougm)
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87617 13f79535-47bb-0310-9956-ffa450edef68
2001-01-08 23:55:12 +00:00
Ben Laurie
45f620672d Make handlers use hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87604 13f79535-47bb-0310-9956-ffa450edef68
2001-01-07 19:55:59 +00:00
Allan K. Edwards
0be0106405 add pool parameter to ap_is_directory and ap_is_rdirectory
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87593 13f79535-47bb-0310-9956-ffa450edef68
2001-01-05 20:44:44 +00:00