1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

285 Commits

Author SHA1 Message Date
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
Ian Holsman
9387a9974d These changes are to allow caching of subrequests via a quick_handler.
* Change SUBREQ_CORE so that it is a HTTP_HEADER (20) filter instead of a content filter (10)
  this allows subrequests to add content filters properly

* Change subreq handling of 'handle-include' so that it splits/passes the brigade before the subreq
  is created. (This allows quick_handler to push content back from this phase)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92956 13f79535-47bb-0310-9956-ffa450edef68
2002-01-21 01:43:30 +00:00
Justin Erenkrantz
29aec5a92c Make core_input_filter use the new apr_brigade_split_line function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92944 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 11:43:37 +00:00
Justin Erenkrantz
e39ae2098d Add AP_MODE_SPECULATIVE support to core_input_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92943 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 11:37:07 +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
Jeff Trawick
c42eed1493 Move a check for an empty brigade to the start of core input filter
to avoid segfaults.

Using prefork MPM and APR_POOL_DEBUG and ElectricFence, I found a
couple of paths where weren't able to report APR_EOF all the way
back up the call tree, leading us back into core_input_filter with
an empty brigade.

Some of the paths in core_input_filter handled it, some didn't.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92835 13f79535-47bb-0310-9956-ffa450edef68
2002-01-12 02:43:31 +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
David Reid
bee20f4291 Restore the apr_pool_clear calls to main.c in case we have
third-parties who are overriding the open_logs hook, in which case
they'd miss the plog being cleared.

Submitted by:	Justin <jerenkrantz@apache.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92771 13f79535-47bb-0310-9956-ffa450edef68
2002-01-08 17:07:19 +00:00
David Reid
c229fe732d This small patch modifies the log's to use plog instead of pconf.
Basically pconf is cleared at different times from plog, and this
has the effect of leaving stderr closed when going into the next
stage of the config. This also had the effect of allowing FreeBSD
with threads to create a pipe with stderr's fd at one end, and this
resulted in problems with the signal polling and high cpu usage.

In addition, move the clearing of plog from main.c to core.c where
it seems more appropriate.

This solves the first and main problem that FreeBSD has with the
threaded MPM's.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92769 13f79535-47bb-0310-9956-ffa450edef68
2002-01-08 16:30:16 +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
Justin Erenkrantz
df91efdc0f Remove a needless immortal bucket creation. We can just leave the
brigade as-is.

Suggested by: Cliff


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92698 13f79535-47bb-0310-9956-ffa450edef68
2002-01-02 05:29:08 +00:00
Brian Pane
4d9b06444e Generalized the recent prep_walk_cache optimizations to allow other
modules to register "notes" within the array of working data in
the core_request_config


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92697 13f79535-47bb-0310-9956-ffa450edef68
2002-01-01 20:36:18 +00:00
Brian Pane
199e4864fc Performance fix for prep_walk_cache():
Moved the directory/location/file-walk caches from the
request's pool userdata hash table to the core_request_config
struct.

This change removes about 60% of the processing time from
prep_walk_cache().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92684 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 08:18:32 +00:00
Jeff Trawick
05ea6a3dcb avoid some ugly sockaddr comparisons in do_double_reverse() by using
apr_sockaddr_equal()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92620 13f79535-47bb-0310-9956-ffa450edef68
2001-12-27 13:28:42 +00:00
Jeff Trawick
187e9ae3b9 Change core code to allow an MPM to set hard thread/server
limits at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92512 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 13:48:54 +00:00
William A. Rowe Jr
a12371d10e Whoops, that's quadstate, the value 3 is not-present.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92460 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 19:44:45 +00:00
William A. Rowe Jr
97ff8a3f1f As suggested by Josh Slive, add the explicit 'default' to AcceptPathInfo.
I'll leave docs up to him.  The conf becomes a quadstate (undef != default)
  but other than that, it should make things cleaner for the user.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92459 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 19:13:23 +00:00
William A. Rowe Jr
6ca3e75ae0 If dconf->accept_path_info is tristate, why not r->used_path_info?
This patch allows us to force path_info off in mod_cgi[d] etc, patch
  forthcoming.  It also allows includes, php, etc to change the undefined
  value in the early handler or late fixup phases to Accept'ed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92448 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 16:11:41 +00:00
William A. Rowe Jr
eb97d00960 Now all should be well. AcceptPathInfo on will give us a document with
path_info served from the core handler.  Any filters can then manipulate
  all the usual CGI envvars [as proven with this little excerpt with a
  <!--#printenv --> document...

<FilesMatch ".*\.shtml.*">
    Options +Includes
    SetOutputFilter INCLUDES
    AcceptPathInfo on
</FilesMatch>

  a potentially questionable config, but effective.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92444 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 05:49:27 +00:00
William A. Rowe Jr
4c3f52cb75 Kill some redundancy (why test PUT when we disallow all but GET/POST?)
and add some thoughts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92441 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 02:35:31 +00:00
William A. Rowe Jr
d68c81274e Periods aren't commas. Clear out some inappropriate casts while
we are at it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92439 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 00:46:40 +00:00
William A. Rowe Jr
638854b09a Whatever this was doing, it looks most unholy.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92438 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 00:43:13 +00:00
Jeff Trawick
1cf0393871 don't lose the const-ness of the string being searched
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92353 13f79535-47bb-0310-9956-ffa450edef68
2001-12-06 02:54:47 +00:00
Brian Pane
a14848d128 Replaced ap_strcmp_match call that checked for a '/' in the
handler name with the equivalent (but less heavyweight)
strchr call


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92352 13f79535-47bb-0310-9956-ffa450edef68
2001-12-06 01:20:16 +00:00
Brian Pane
3eda1aaad8 Another performance-related change to core_output_filter(): if we
get a long stream of small buckets, so that multiple concatenation
steps are required in a single pass through the brigade, re-use the
buckets from the previous temp brigade when creating the next one.
This allows us to avoid making yet another copy of the previously
concatenated data.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92197 13f79535-47bb-0310-9956-ffa450edef68
2001-11-27 08:39:02 +00:00
Brian Pane
8ac8cb4842 Optimization for core_output_filter: if the iovec is full,
don't try to concatenate buffers if we already have at least
8KB of data ready to send.  Instead, just split the brigade
and send what's currently in the iovec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92196 13f79535-47bb-0310-9956-ffa450edef68
2001-11-27 06:35:29 +00:00
Cliff Woolley
c32bd92a5b The survey says yes, that is in fact the expected behavior. :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92182 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 18:49:36 +00:00
Brian Pane
eb4b1ead89 Another fix for the core_output_filter() code that concatenates
small buckets: It's possible for the temporary brigade to
contain more than one bucket.  If this happens, we need to
recover the buckets after the first from the temporary brigade
before destroying it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92176 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 08:49:29 +00:00
Brian Pane
df871d8895 More fixes for core_input_filter()'s concatenation of small buckets:
update last_e and nbytes after compacting the brigade


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92174 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 07:21:48 +00:00
Brian Pane
a18f8fe052 Fix for the code in core_output_filter() that concatenates small buckets
into one big bucket...it was putting a pointer to a deleted bucket in
the iovec, so the output was corrupted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92171 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 03:51:40 +00:00
Ian Holsman
c7c6e876a9 change open_logs hook to return a value, allowing you to flag a error
while opening logs

Obtained from: Doug MacEachern


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92149 13f79535-47bb-0310-9956-ffa450edef68
2001-11-24 00:08:30 +00:00
Ryan Bloom
4209647600 Fix a bug in the core_output_filter. If we are buffering, it helps
to read from the correct bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92146 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 19:28:04 +00:00
Ian Holsman
86b792b21c Modify post_config hook so that it can return a error,
causing the server not to start.
previous method was to call exit(1) which would not fail
gracefully

PR:
Obtained from:
Submitted by:
Reviewed by:	(Idea only Jeff Trawick)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92144 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 16:35:22 +00:00
Ryan Bloom
aca4da4092 Fix a bug in our output filter buffering. If a lot of small brigades are
sent, the core will send the first 16 buckets, regardless of how much
data there is.  In the pathological case, this can cause a lot of 16
byte packets.  Now, if we see less than AP_MIN_BYTES, we combine
all of the buckets into a single bucket to be sent in a later packet.

This can cause a lot of memory copies, but it eases our network traffic.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92097 13f79535-47bb-0310-9956-ffa450edef68
2001-11-21 18:25:40 +00:00
Ryan Bloom
d70af2b3eb Fix the timeout logic that I broke last week. This adds a request
level filter that sets the timeout on the socket that is connected
to the client.

Thanks Greg Stein for seeing this bug.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92073 13f79535-47bb-0310-9956-ffa450edef68
2001-11-21 03:46:22 +00:00
Doug MacEachern
4b9c521468 add new input filter mode AP_MODE_INIT:
allows filters such as mod_ssl to initialize a client connection
(ie handshake) before reading request data from the client.
PR:
Obtained from:
Submitted by:   dougm
Reviewed by:	wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92042 13f79535-47bb-0310-9956-ffa450edef68
2001-11-19 22:36:20 +00:00
Ian Holsman
4f1a15140d change the signature of ap_custom_response() to use a
"const char *" instead of a "char *".


PR: 8791
Submitted by: Kurt Brown kurtb149@yahoo.com
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92024 13f79535-47bb-0310-9956-ffa450edef68
2001-11-18 02:57:12 +00:00
Ryan Bloom
a4f00625aa Pull lingering close out of the pool cleanup phase. This was causing too
many bugs.  Instead, it is called where it used to be called.  I have
abstracted some of the logic out of the lingering close so that it gets
the socket from the connection using the core's conn_config vector.  This
is in anticipation of a change to use a hook for the lingering close,
which I hope to do soon.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91968 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:49:54 +00:00
Ryan Bloom
137a02bb3b FTYPE_CONTENT - 1 isn't enough for OLD_WRITE. OLD_WRITE is a special
filter, and it MUST run absolutely first.  To allow other filters a little
space to manuver, I am moving this to FTYPE_CONTENT - 10.

Submitted by:	John Sterling <sterling@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91962 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 04:39:55 +00:00
Ryan Bloom
8a697835fe Get the proxy module compiling again. This is a hack to get past the
current compiler errors.  Basically, the core now puts the socket
in the conn_rec->conn_config vector.  The proxy grabs that socket and
uses it where it used to use the client_socket field from the conn_rec.
Long-term, all of the direct socket communication needs to be removed,
and this should go through a filter stack.  Short-term, this gets the
proxy working again.

I have tested http and connect, but I haven't looked at the FTP proxy,
although it does compile now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91952 13f79535-47bb-0310-9956-ffa450edef68
2001-11-14 21:18:47 +00:00
Ryan Bloom
790872b869 Move this to a HOOK_MIDDLE location. We need to add some logic to
make sure that we have a socket that the core controls if we do this,
but it is more correct.

Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91922 13f79535-47bb-0310-9956-ffa450edef68
2001-11-14 00:38:16 +00:00
Ryan Bloom
695081280d Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91913 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:29:54 +00:00
Ryan Bloom
3d76585bad Back out my last patch. The logic to add sockets to pollsets is back in
the MPM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91906 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 17:44:07 +00:00
Ryan Bloom
a47ed5762d This allows modules to add socket descriptors to the pollset. I have
only added this to the perfork MPM, and the others work without it.
Tomorrow I will add it to the other MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91899 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 07:15:36 +00:00
Ryan Bloom
44baa0367f Cleanup some code that was created during the abstration. This basically
takes the old ap_new_connection, and puts into the new core_create_conn
function.  There is no good reason to have two functions to do this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91890 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 02:09:07 +00:00
Ryan Bloom
26444e2900 Remove more network logic from the MPMs. Essentially, each MPM can define
AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK, which tells Apache to disable_nagle
on the accepted socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91889 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 01:24:42 +00:00
Ryan Bloom
0c05b625ac Begin to abstract out the underlying transport layer.
The first step is to remove the socket from the conn_rec,
the server now lives in a context that is passed to the
core's input and output filters. This forces us to be very
careful when adding calls that use the socket directly,
because the socket isn't available in most locations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
Martin Kraemer
ac0d5e6317 Fixed previous patch to reflect what Apache-1.3 did regarding self-
referential uri's, and updated the manual accordingly.
XXX There is a kludge here: XXX the port number from the client's Host:
header used to be tossed, and there is no clean mechanism to pass it
(in the request_rec) to other consumers. As the unparsed_uri structure
(which could avoid repeated parsing of URI, Host, Port etc) seems to be
mostly unused currently, I used that to pass the port.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91798 13f79535-47bb-0310-9956-ffa450edef68
2001-11-08 14:29:37 +00:00
Martin Kraemer
cd4e5d9455 When no port is given in a "ServerName host" directive, the
server_rec->port is now set to zero, not 80. That allows for
run-time deduction of the correct server port (depending on
SSL/plain, and depending also on the current setting of
UseCanonicalName). This change makes redirections
work, even with https:// connections. [Martin Kraemer]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91797 13f79535-47bb-0310-9956-ffa450edef68
2001-11-08 12:34:21 +00:00
Greg Ames
0dacbadb39 insure that we die quickly without looping etc. if somebody messes up
*readbytes again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91726 13f79535-47bb-0310-9956-ffa450edef68
2001-11-02 15:17:06 +00:00