1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-04 21:42:15 +03:00

99 Commits

Author SHA1 Message Date
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Cliff Woolley
aaf0424e2b get rid of _FOREACH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101788 13f79535-47bb-0310-9956-ffa450edef68
2003-11-16 02:09:14 +00:00
André Malo
3c95b5e98e While processing filters on internal redirects, remember seen EOS
buckets also in the request structure of the redirect issuer(s). This
prevents filters (such as mod_deflate) to add garbage to the response,
because ap_finalize_request_protocol won't send another EOS bucket then.

PR: 14451


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98699 13f79535-47bb-0310-9956-ffa450edef68
2003-02-18 00:23:20 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Ian Holsman
6deba78a9a Renames Pending:
This clears the list of renames pending in apr-util.
 Parts of this list was alreadu done, but the pending list hadn't been updated.

 apr_hook_debug_current     from apr_current_hooking_module
 apr_hook_debug_show        from apr_show_hook

 apr_hook_global_pool       from apr_global_hook_pool
 apr_hook_sort_all          from apr_sort_hooks

 apr_uri_port_of_scheme     from apr_uri_default_port_for_scheme
 apr_uri_unparse            from apr_uri_unparse_components
 apr_uri_parse              from apr_uri_parse_components
 apr_uri_parse_hostinfo     from apr_uri_parse_hostinfo_components

 apr_uri_t                  from apr_uri_components

 All APR_URI_*              from all APU_URI_* symbols
 All APR_UNP_*              from all UNP_* symbols

PR:
Obtained from:
Submitted by:	 Thom May
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95966 13f79535-47bb-0310-9956-ffa450edef68
2002-07-06 20:04:38 +00:00
Justin Erenkrantz
798c1dae43 Add a filter_init function to the filters so that a filter can execute
arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include
requests since ap_meets_conditions() is not aware that this is a dynamic
request and it is not possible to satisfy 304 for these requests (unless
xbithack full is on, of course).  When mod_include runs as a filter, it is
too late to set any flag since the handler is responsible for calling
ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL
as the argument and all is well.

PR:	9673
Reviewed by:	Ryan Bloom and others


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95906 13f79535-47bb-0310-9956-ffa450edef68
2002-06-28 08:40:25 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +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
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
Justin Erenkrantz
3058b601ff As hinted on dev@httpd, change filter naming schemes to match our
expectations of their usage.

The reason that we should make this change now is that we have changed
the implied meaning of AP_FTYPE_HTTP_HEADER - some users of this should
be PROTOCOL while others should be CONTENT_SET.  In order to clarify it,
toss all of the bogus names and force the filter writers to make sure
they understand what they are doing.

CONTENT_SET is new (horrible name - change if you have better idea), but
it indicates that it should run between RESOURCE and PROTOCOL.
mod_deflate is the ideal CONTENT_SET filter.

The changed type names are:
CONTENT is now RESOURCE.
HTTP_HEADER is now PROTOCOL.  However, most filters that used HTTP_HEADER
may want CONTENT_SET.  (Only things like POP and HTTP belong as PROTOCOL.)

MMN bump since all filters need to be recompiled due to filter reordering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93756 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 09:27:17 +00:00
Justin Erenkrantz
6c111e95db When using mod_ssl, it is possible that we'd be called when there are no
protocol filters, so stop the segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93755 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 08:58:21 +00:00
Ryan Bloom
116497445f Remove the prev pointer from the filter chain. This removes
the complexity of trying to set the filter chain correctly, with the
side-effect of forcing us to walk the entire chain whenever we add
a filter.  Since the filter chains are small, the decrease in
complexity is worth it.
Reviewed by:	Allan Edwards


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93745 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 02:09:30 +00:00
Allan K. Edwards
1fc7cb3778 make sure r->proto_xxput_filter gets updated as necessary when
deleting a filter from the chain


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93732 13f79535-47bb-0310-9956-ffa450edef68
2002-03-06 17:29:39 +00:00
Ryan Bloom
2f43d87c48 Stop the loop when we have found the correct filter, or when the filter
list is over.  Do not stop if the next filter is NULL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93708 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 05:21:13 +00:00
Ryan Bloom
b202fc0556 If we insert a protocol filter before we insert a request filter, we
must set the r->output_filter to r->proto_output_filter.  If we don't,
then as soon as we insert the request filter, the protocol filter will
be removed.  This was causing headers to not be sent on some requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93692 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 05:29:04 +00:00
Ryan Bloom
be6629235f I forgot the return, which mean meaningless log messages. This makes us
return the correct information.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93687 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:18:45 +00:00
Ryan Bloom
596d79f14b This fixes most of the header bug that was committed last night. The server
is seg faulting on pipelined requests currently, but I want to get people
back to a running server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93686 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:04:03 +00:00
Ryan Bloom
0d7f234515 This finishes the mod_dir/mod_negotiation bug. This final part of the
solution ensures that we don't lose filters if they are added later than
we expect.  The problem could be seen if a connection filter was added
after a request-based filter was added in the past.  The problem was that
the request-based filters pointed to the first filter in the connection
record, so the new connection filter was never called.  Now, all filters
are put on their correct filter lists, and we are sure to always update
all pointers when adding a filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93683 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 06:04:08 +00:00
Ryan Bloom
9ac46ee310 Fix the mod_dir/mod_negotiation bug, where redirects and sub requests
were not getting the correct filters.  This is done by creating a location
in the request rec that holds protocol level filters.  Protocol level
filters survive for one request, from the time the request is received
from the user to the time the response is sent.  r->output_filters now
stores the request level filters, which are only valid for the lifetime
of one request_rec.

This patch works, but it is not complete.  The second half of the problem
is that add_any_filter doesn't check where it puts the filters that it
adds, so it is possible for filters to be put on this wrong list, and
for filters to be lost completely during request processing.  That half
of the fix will be coming in the next day or so.

Submitted by:	Will Rowe, Justin Erenkrantz, Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93682 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 02:15:52 +00:00
Ian Holsman
78656a3bf1 forgot the ap-declare's
the're needed for win32


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93545 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:58:05 +00:00
Brian Pane
2df244dfda Added ap_get_input_filter_handle() and ap_get_output_filter_handle()
Submitted by:	Ryan Morgan
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93544 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:12:31 +00:00
Brian Pane
08002aaebb Added new functions ap_add_input_filter_handle() and
ap_add_output_filter_handle()

There are many places in the core modules where we do
ap_add_input_filter() or ap_add_output_filter() on a
hardcoded filter name (e.g., "CORE" or "BYTERANGE").
This requires a string-to-filter mapping that wastes
CPU time.  (Even though the string lookup uses a trie
for speed, it still ranks as a big consumer of CPU time
because of the large number of filters added per request.)

The new ap_add_*_filter_handle() functions will allow
us to skip the string-to-filter mapping in cases where
the module adding the filter happens to have the
ap_filter_rec_t* for the registered filter (e.g., because
it's the same module that registered the filter in the
first place).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93039 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 01:54:54 +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
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
Justin Erenkrantz
b228a3b800 Fix a shadow variable. (c is also declared to be the connection.)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92635 13f79535-47bb-0310-9956-ffa450edef68
2001-12-28 05:46:21 +00:00
William A. Rowe Jr
f4cf541a13 While contemplating a cast to (char) for the c arg to trie_node_link,
I decided it's more plesant to let the cpu not to think so hard (no
  wasted space, the c member will by word aligned anyways.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92449 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 16:39:08 +00:00
Brian Pane
d99851e09d converted apr_pcalloc to apr_palloc for 15% reduction in run time of add_any_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92142 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 11:07:51 +00:00
Brian Pane
f2cd29ad41 replaced the hash used in add_any_filter() with a trie for 2.5x speedup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92140 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 01:24:18 +00:00
Ryan Bloom
cac07fa8d9 A very small optimization to the OLD_WRITE logic. This just makes us store
a pointer to the OLD_WRITE frec, and instead of using strcmp or strcasecmp,
we can just do a simple pointer comparison.  This optimization is also
available to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91006 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 18:38:21 +00:00
Justin Erenkrantz
0fbd80ebb0 Jeff pointed out that the character array must be constant.
Well, it's not, so make it allocated from the correct pool rather than
the heap.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90891 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 16:28:45 +00:00
Justin Erenkrantz
54a804a28e **NO CODE CHANGES**
This is a reformat commit *ONLY*
Please drive on through.

(One spelling tpyo fixed...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90889 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 06:57:58 +00:00
Justin Erenkrantz
4c59c0cfdc The ap_add_input_filter/ap_add_output_filter functions do an O(n) scan
through the list of registered filters.  This patch replaces the linear
list with a hash table for better performance.
Submitted by:	Brian Pane <bpane@pacbell.net>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90888 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 06:50:52 +00:00
Doug MacEachern
73b79caab0 fix ap_remove_output_filter; the recent change to use remove_any_filter made
it possible to wipe out the entire filter chain.  and then when
ap_finalize_request_protocol was called, r->output_filters was NULL,
preventing data from being flushed to the client.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90801 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 05:25:31 +00:00
Jeff Trawick
73fc59156a remove_any_filter() and ap_remove_foo_filter() are void; how can you
return a value?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90726 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 12:36:07 +00:00
Ryan Bloom
bfe91354fb Allow mod_ssl to send back an error message if an HTTP request is sent
over an HTTPS connection.  This also adds an ap_remove_input_filter
function, which should be used to remove the SSL input filter in this
case, as soon as this code is stressed a bit more.

For right now, we are sending the same message that we used to send in
mod_ssl for Apache 1.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90724 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 06:00:51 +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
Ryan Bloom
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
Greg Stein
0c0d157331 Convert the filter and brigade writing functions to return status values,
not byte counts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89305 13f79535-47bb-0310-9956-ffa450edef68
2001-06-08 11:00:14 +00:00
Greg Stein
2e11444a8d *) Add apr_bucket_setaside_noop to use for buckets that do not require a
setaside function. It simply returns APR_SUCCESS.
   - adjust the EOS, FLUSH, IMMORTAL, and HEAP buckets to use _noop.

*) Make the setaside() function take a pool to define the (new) lifetime for
   the bucket's data.
   - Adjust the apr_bucket_setaside() macro.
   - Adjust the apr_bucket_setaside_notimpl() and transient_setaside()
     functions.
   - Pass the additional parameter in ap_save_brigade()

*) Update docs for setaside()

*) Minor nit with macros in apr_buckets.h: add parens for binding safety.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89289 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 10:13:25 +00:00
Ryan Bloom
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
Greg Stein
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
Ryan Bloom
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
Ryan Bloom
358858ff36 The ap_f* functions should flush data to the filter that is passed in,
not to the filter after the one passed in.  The fixes a bug, where one
filter is skipped when using ap_f*.
Submitted by:	Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88832 13f79535-47bb-0310-9956-ffa450edef68
2001-04-12 20:06:50 +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
e094051e4f Fix a compile warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88092 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 19:10:42 +00:00
Ben Laurie
29a10959c0 First cut of TLS support.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88090 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 17:46:19 +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
Greg Stein
a66d4ddfe2 "v" in the name has come to mean that a va_arg is in the parameter list.
putstrs is clearer in this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88041 13f79535-47bb-0310-9956-ffa450edef68
2001-02-09 22:57:50 +00:00