Graham Leggett [Sat, 29 Sep 2001 19:51:55 +0000 (19:51 +0000)]
Fixing the mod_proxy docs. The docs were transferred away without a history,
so I'm applying each of the new patches one by one (there are only a few of
them) so that the new mod_proxy.html file is up to date.
This first patch returns the original doc to the tree. Subsequent patches
will apply the changes to the file up to date.
PR:
Obtained from:
Submitted by:
Reviewed by:
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.
Implement suggested input filter improvements from Greg and Ryan.
- Clean up scopes and namings of certain variables
- Add comments about potentially bogus modes
- Consolidate a FOREACH loop into a single brigade_length call
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)
If we are *already* a faux URI (i.e. relative file sub req) and we then
make a subrequest from that faux URI to a file in the same directory,
we'd try to build a URI out of the fake URI which leads to the wrong
thing happening somewhere down the line. So, let's just give this
special case a fake URI as well.
OtherBill needs to verify this. He can back it out if he wants. I
don't much care. It's one line and it seems okay...
Optimize file_walk with the same logic as location_walk. Fix both to
have a bit more legibility, and tighter locality of scope for a smaller
number of variables.
MAJOR charset encoding fixes. The file names and HTTP-Equiv tags are now
in sync with the httpd-std.conf - and the ucs2/4 encodings are gone since
utf8 is a universally recognized shorthand that sits much better in our
tree [notice; these were _duplicate_ character sets, only in different
byte encodings!] Same with removing the duplicate .jis and .is-kr files.
[I simply choose the one 'with link' over the one without, and fixed the
links back to preFAQ as I picked.]
Russian users, how many of the remaining five encodings are truly needed?
Overhaul the compatibility with 1.3's subrequest and redirect processing.
Eliminate URI-centric phases in ap_process_request_internal() for pure
file subrequests (that don't correspond to URI space.) translate_name
hook and location_walks are skipped for these requests.
Moves the reset of the per_dir_config out of directory_walk into the
internal request processing code, so that resources with alternate
map_to_storage requirements start with clean r->server->lookup_defaults.
Optimizes out the authn/authz of effectively identical subreqests and
redirects, as the sub_req_lookup calls once did. Unlike 1.3, we copy
r->user and r->ap_auth_type from main/prev for the request's reference.
Stop copying the subrequest's r->chunked flag (Rbb assured me it looked
bogus, chunking is on the parent request) and clean out other #if 0'ed
cruft we don't need to refer back to anymore.
Immortal data should go in an immortal bucket, not a pool bucket. It would
still work in a pool bucket, but only by coincidence. At the very least, a
pool bucket is way more overhead than this poor unsuspecting little CRLF
needs to get by.
Mark J. Cox [Wed, 26 Sep 2001 08:25:14 +0000 (08:25 +0000)]
Update the mime.types file to the registered media types as
of 2001-09-25, and add mapping for xsl extension
PR:
Obtained from:
Submitted by:
Reviewed by:
Ryan Bloom [Tue, 25 Sep 2001 15:58:52 +0000 (15:58 +0000)]
httpd.exp is a generated file, and therefore, it is generated into the
build directory, not the source directory. When we go to use it, we
have to look in the build dir for it.
Ryan Bloom [Mon, 24 Sep 2001 23:03:42 +0000 (23:03 +0000)]
Clean the worker MPM a bit. This removes the idea of compiling worker
with no threads. That doesn't make any sense anyway. Also, raise
HARD_SERVER_LIMIT to 16, from 8.
Joy, joy. Relax the rules, just a wee bit, and prepare to move the fatal
ending to this filename-less request a bit later in the request cycle, to
give older, ported modules more time to cope without implementing
the map_to_storage hook.
Ryan Bloom [Mon, 24 Sep 2001 06:42:12 +0000 (06:42 +0000)]
Fix MaxClients in the Worker MPM, so that it specifies the maximum
number of clients that can connect at the same time, instead of
specifying the maximum number of child processes.
Submitted by: Aaron Bannert <aaron@clove.org>
revert buckets sms phase 1 patch. the group wants to get rid of SMS, so
the buckets can't use it. I'll implement a free-list scheme private
to the buckets next. in the meanwhile we're back to using malloc/free
directly instead of via the std sms.
Ran w3c tidy on these as 'tidy -mi -asxml' to get xhtml. Please verify,
in particular, the non-english files, to make sure I did not screw
anything up. They look fine to me.
kill -l requires the short version of the signal (without SIG prefix).
(apachectl graceful was broken.)
The best way to do this is to change configure to internally represent
the signal without the SIG prefix and prepend SIG before substitution
(and export a version without the SIG prefix for apachectl).
This highlights why we want to move apachectl's core functionality into
httpd.
AFAICT, we have never created server configs of _all_ modules for _all_
contexts, only when they come up (e.g., a directive of that particular
module is provided) with the except that vhost containers complete the
initialization of all modules. I haven't stepped this, but it appears
to be correct.
This patch assures we can merge two incomplete directory sections
together. They will (obviously) need to be merged with a LHS default,
e.g. a vhost's or main server's default dir config. That's fine, this
just allows either the LHS or RHS value to be null, and for merging to
still succeed.
Jeff Trawick [Thu, 20 Sep 2001 17:54:51 +0000 (17:54 +0000)]
Currently, when the map-to-storage handler for TRACE returns DONE, the
caller -- ap_process_request_internal() -- catches that and returns
OK to its caller -- ap_process_request(). But ap_process_request(),
seeing OK, tries to run a handler. It needs to skip that if the
request was completed in ap_process_request_internal().
Ian Holsman [Thu, 20 Sep 2001 05:34:50 +0000 (05:34 +0000)]
Added New Option 'HTTPProxyOverrideReturnedErrors' which lets the server override
the error pages returned from the proxied server and replace them with the standard
server error handling on the main server.
Jeff Trawick [Wed, 19 Sep 2001 18:47:31 +0000 (18:47 +0000)]
if we're gonna trash the connection due to a queue overflow, at the
very least we should close the socket and write a log message (mostly
to aid debugging, as this is a showstopper problem)
this is no fix; there is a design issue to consider; hopefully this
will
There is still some stuff I'd like to do here, but I'll commit what
I have for the moment. I've done three things:
1. Emphasize that auth does not need to be in .htaccess.
2. Add detailed discussion of each of the auth directives (does this
belong here?)
3. Remove the AuthGroupFile /dev/null which shouldn't be necessary.
The call to apr_explode_localtime() in mod_log_config is one of the more
expensive operations in the httpd. This patch attempts to reduce the
overhead by caching the result for 15 seconds.
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Cliff Woolley, Ryan Bloom, Dean Gaudet, Justin Erenkrantz
I was kinda hoping those (void)some_function() and (request_rec *)NULL
casts would go away before this committed, but alas I didn't say anything.
:-) This gets rid of them and a few others just like them that I also
found in worker.c.
Fix case where an included file may change but the shtml file has not -
since we returned Last-Modified/ETag headers, we said that it was possibly
cacheable. Wrong.
See RFC 2616 13.3.4 for more details (these are SHOULD/MAY clauses, so I
think we can discard them when we are dealing with dynamic data).
(Justin cleaned up the comment to cite RFC 2616.)
Submitted by: Ian Holsman <ianh@cnet.com>
Reviewed by: Justin Erenkrantz, Aaron Bannert, Brian Pane
This patch fixes a nasty bug in the worker MPM where the
state of the worker threads was not being reported back to the
scoreboard, and eventually all the threads running in the children
would be reported as being in the "C -- closing connection" state.
This would wreak havoc on the idle_server_maintenance() routine. Since
these threads would never be counted as idle, the server would
spawn children as fast as possible.
Switch back to SIGUSR1 for graceful restarts on all platforms that
support it. This defines a symbol called AP_SIG_GRACEFUL in
ap_config_auto.h which will have the appropriate signal value. All
direct references to SIGWINCH have been replaced with AP_SIG_GRACEFUL.
On Linux 2.0, use SIGWINCH instead since SIGUSR1 is used by glibc
2.0's user-space threading library to control threads. All later
versions of Linux/glibc don't have this problem. (Not to mention the
security holes in older Linux versions which make it unsuitable for
use as a web server.) If your platform doesn't have SIGUSR1, use the
appropriate mojo in configure to define what your graceful restart
signal should be.
In theory, a configure switch could be added to allow the admin to
specify the appropriate signal that should be used. This is left
as an exercise to the reader for now.
The docs need to be updated. Since the signal is now configurable,
just saying SIGUSR1 for graceful restart isn't completely true. Also,
the apachectl functionality needs to be moved into httpd - this is
what Win32 does and it makes us consistent across platforms.
Roy issued a veto against use of SIGWINCH by default, so this should
resolve that veto.
Ryan Bloom [Tue, 18 Sep 2001 21:14:18 +0000 (21:14 +0000)]
Cleanup the worker MPM. We no longer re-use transaction
pools. This incurs less overhead than shuffling the pools
around so that they can be re-used. Remove one of the
queue's condition variables. We just redefined the API to
state that you can't try to add more stuff than you allocated
segments for.
Revamp the API that mod_dav uses to talk to back end deadprop (propdb)
providers. The old API was really based on how the FS stored properties, but
sucked for other types of providers (SQL databases, Subversion, etc). This
new code is overall much cleaner as it moves from a DBM style API to one
tuned for actual mod_dav operation; it also more flexible/clearer for future
improvements (e.g. dropping props directly to the wire rather than buffering
in memory).
This new API allows the provider to better define namespace handling during
the output of the values, how values are serialized and stored, the mapping
between elements' namespaces and the internalized namespace storage, a
clearer mechanism for naming properties (dav_prop_name), and an explicit
rollback mechanism to deal with PROPPATCH atomicity.
Updated the FS provider (fs/dbm.c) to the new API, mostly by moving code
from main/props.c. Of course, with the new semantics, some big changes in
the namespace mapping were made.
Now that we have apr_datum_t, convert some uses of dav_datum over to
apr_datum_t (the two are equivalent).
Expose some of the DAVFS' internal DBM cover functions and have the locking
code use them directly, rather than thru the vtable. That vtable will be
changing shortly, so this shift is needed.
Remove the Win32 script-processing exception from mod_cgi, and
roll build_command_line/build_argv_list into a unified, overrideable
ap_cgi_build_command optional function.
Eliminates a ton of Win32 cruft from core.c for registry parsing.
Win32 (through the default handler, and newest changes to the
apr_proc_create fn) continues to serve .bat/.exe files. This is in
preparation for adding modules/arch/win32/mod_win32 for scripts.
Please review the mod_cgi.c behavior very carefully.
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>
Found the persistent connection problem I've been observing. Nasty result of
the problems in the input filter stack. Time to rejigger, per the
discussions we've had.