Use the appropriate APR_FINFO_flags for the apr_stat/lstat/getfileinfo
calls to avoid ownership and permissions on Win32 when they are not
required, and until they are implemented.
Ryan Bloom [Sat, 27 Jan 2001 18:23:49 +0000 (18:23 +0000)]
Fix a seg fault. The problem is easy to explain. On a HEAD request, Good
handlers will send their data down the filter stack, but 1.3 handlers will
just return, giving us a Content-Length of 0. Since we can't send a C-L
of 0 just because it is a HEAD request, we search the headers_out table
for a 0 C-L if it is a HEAD request. The problem is that some filters
will not allow (includes_filter) a C-L to be computed, so we end up without
a C-L header in headers_out. Thus, when we do a strcmp against the header
value and "0", we seg fault, because the header value is NULL.
To fix this, we grab the element from the header table, and make sure it
isn't NULL before doing the strcmp.
Ryan Bloom [Sat, 27 Jan 2001 17:17:51 +0000 (17:17 +0000)]
Cleanup the error bucket code a bit. This uses the error bucket directly
instead of using ap_bucket_read. It also lets ap_die handle the fact that
the filter returned the error.
Submitted by: Greg Stein
Was there a file that wasn't updated with the error buckets patch?
Here's the export symbol for http_protocol's error bucket type, but
I can't find the actual instance (which needs AP_DECLARE_DATA as well.)
Ryan Bloom [Sat, 27 Jan 2001 07:13:39 +0000 (07:13 +0000)]
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.
Ryan Bloom [Fri, 26 Jan 2001 17:54:06 +0000 (17:54 +0000)]
Stop using the request filters to filter an error response. This fixes a
bug where we were using the byterange filter to filter an error, which
caused us to close the connection before we had sent any data. Currently,
we only keep the three most important filters, but we may need to add more
in the future. I am mostly thinking of the charset translation filter.
Greg Stein [Fri, 26 Jan 2001 11:44:51 +0000 (11:44 +0000)]
Provide a way to allow get_resource and get_parent_resource to return errors
that might occur during the parsing of the URI and/or the lookup of the
resource in the repository.
Specifically: return a dav_error* and move the returned dav_resource* to an
"out" parameter of the hook function.
Greg Stein [Fri, 26 Jan 2001 09:05:40 +0000 (09:05 +0000)]
apr_put_os_file() expected the caller to have an existing file or init to
NULL. using an existing file doesn't normally work: where would you get a
blank file to shove an FD into? expecting the user to assign to NULL is
error-prone (mod_isapi didn't).
*) always create and return a new file from apr_put_os_file()
*) reimplement apr_open_stderr() in terms of apr_put_os_file()
[ except for win32... some issues there ]
*) remove some (obsolete) inits to NULL
Greg Ames [Thu, 25 Jan 2001 18:29:35 +0000 (18:29 +0000)]
add highperformance-std.conf . The -std name allows make install to work
its magic.
Slightly changed from highperformance.conf : I added "User" and "Group" so
it works right out of the box on Linux. Group will no doubt need editing on
other platforms.
I'll remove docs/conf/highperformance.conf from CVS once I find out the
right way to do it. (Hints appreciated)
Ryan Bloom [Wed, 24 Jan 2001 23:47:42 +0000 (23:47 +0000)]
As Greg noted, set_keepalive has to happen before we check r->chunked, but
it also has to happen after ap_basic_http_header. Otherwise, we don't
set r->connection->keepalive correctly, and it can be -1 for requests that
don't support keepalive. This moves ap_basic_http_header to above the
call to set_keepalive (after reversing the previous patch), which should
be perfectly safe, while still fixing the original bug.
Submitted by: Greg Stein
Ryan Bloom [Wed, 24 Jan 2001 23:07:23 +0000 (23:07 +0000)]
The ap_set_keepalive call needs to be after the call to
ap_basic_http_header. Without this, there are times that HTTP 1.0
requests will do keepalive connections.
Greg Stein [Wed, 24 Jan 2001 10:24:03 +0000 (10:24 +0000)]
- change the prototype for apr_dbm_geterror() [and update dav/fs/dbm.c]
- fix up some error handling in apr_dbm.c
- use "dbm" consistently for the apr_dbm_t parameter
Greg Stein [Wed, 24 Jan 2001 06:17:26 +0000 (06:17 +0000)]
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.
Tony Finch [Wed, 24 Jan 2001 01:05:47 +0000 (01:05 +0000)]
Relax the checking of Host: headers so that only character sequences that
are sensitive to the filesystem are rejected, i.e. forward slashes,
backward slashes, and sequences of more than one dot. This supports iDNS
without compromising the safety of mass vhosting.
Ryan Bloom [Tue, 23 Jan 2001 23:05:12 +0000 (23:05 +0000)]
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.
Ryan Bloom [Tue, 23 Jan 2001 07:30:11 +0000 (07:30 +0000)]
Fix the byterange filter for the case where the bucket can't be
copied natively. This will only ever happen if a bucket can be split
but not copied, because we read the bucket in apr_brigade_partition if
we can't split it. Regardless, this is much safer. This should also fix
all of the problems with the byterange filter.
Time to refresh this version (thought we should rename it I suppose.
Not yet revamped for buckets, we won't want to keep them in sync if
we get to the stage of eliminating the ap_rputs mechanics from the
live module. This remains the classic 'old-style' module for general
performance testing.
Ryan Bloom [Tue, 23 Jan 2001 05:57:32 +0000 (05:57 +0000)]
Cleanup the byterange filter to use the apr_brigade_partition
and apr_bucket_copy functions. This removes a lot of very messy
code, and hopefully makes this filter more stable.
Accomodate the change to the apr_read_dir() arguments, and change all
apr_dirfoo() and apr_foodir() commands to apr_dir_foo() to match the
earlier-renamed apr_dir_open().
Ryan Bloom [Mon, 22 Jan 2001 21:57:57 +0000 (21:57 +0000)]
AP_REQUEST_DONE is bogus and a bad idea. This had the http_header filter
return -3 for every HEAD request, which in turn made us call ap_die. Of
course, if we didn't have a 200 status (say we had a 206), then we would
seg fault, because we would end up sending down a second EOS bucket, which
would in turn make us call the byterange filter again, but at this point,
we hadn't cleaned up the byterange ctx structure, because it was never
supposed to be called again.
This was biting us on apache.org, where we had a HEAD request for
bytes=100- for a file. This was a major seg fault. We are better off
just returning OK is much safer.
Ryan Bloom [Sun, 21 Jan 2001 22:14:16 +0000 (22:14 +0000)]
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.
Ryan Bloom [Sun, 21 Jan 2001 17:22:18 +0000 (17:22 +0000)]
If --enable-suexec is specified, then we need to build suexec
automatically. This bit me multiple times last night as I was trying to
setup apache.org. I would make a change to the configuration, run make;
make install, and it would fail. The problem was that suexec wasn't
getting re-compiled ever, so my changes weren't getting picked up. This
solves that problem, by making sure that suexec gets compiled if it was
specified on the configure line.
Ryan Bloom [Sun, 21 Jan 2001 05:26:45 +0000 (05:26 +0000)]
Back out the last change (the one that went in without a commit log)
I thought this change was necessary to stop reporting the SERVER_VERSION
twice. In reality, the apr_hook_deregister_all() call in
ap_clear_module_list solved that problem.
Ryan Bloom [Sun, 21 Jan 2001 05:21:32 +0000 (05:21 +0000)]
Add a call to apr_hook_deregister_all() in the clear_module_list function.
The basic problem was that when we load the modules, we call the
register_hooks() function from the module, but then we clear the module
list for all active modules, and add them back in one at a time. When we
add them back, we re-call the register_hooks() function, thus adding
each function a second time. This was causing apache.org to log every
request twice in the access log. By calling apr_hook_deregister_all()
when we unload the module, the second call to register the hooks is the
only call that matters.
The changes required for the APR_FINFO_wanted argument to
apr_stat/lstat/getfileinfo. These are -NOT- optimal, they
are simply the required changes to get the server working.
The size of the patch is a warning about how we need to
really look at what we are trying to accomplish with all
of these stat/lstat calls.
Ryan Bloom [Sat, 20 Jan 2001 06:05:15 +0000 (06:05 +0000)]
Move initgroupgs, ap_uname2id and ap_gname2id from util.c to
mpm_common.c. These functions are only valid on some platforms,
so they should not be in the main-line code.
These functions are also not portable to non-unix platforms, so they don't
really belong in APR. Since they are only used in MPMs, for right now,
I am moving them to mpm_common.c
Ryan Bloom [Sat, 20 Jan 2001 05:18:06 +0000 (05:18 +0000)]
Remove ap_chdir_file. This function is not thread-safe, and nobody
is currently using it. The proper way to do this, is to use the
apr_create_process API.
Joshua Slive [Fri, 19 Jan 2001 19:44:45 +0000 (19:44 +0000)]
Remove the direct links to the Apache web site from the welcome pages
so that all the clueless people of the world can find someone else
to complain to about their missing porn site.
Ryan Bloom [Fri, 19 Jan 2001 17:19:51 +0000 (17:19 +0000)]
Stop checking to see if this is a pipelined request if we know
for a fact that it isn't. Basically, if r->connection->keepalive == 0.
This keeps us from making an extra read call when serving a 1.0
request.
Submitted by: Ryan Bloom and Greg Stein
Greg Ames [Fri, 19 Jan 2001 16:02:54 +0000 (16:02 +0000)]
updated to work with either prefork or the pthread mpms.
I've been using specialized versions of this for ages. Time to commit it.
If nobody objects, I'd like to rename it highperformance-std.conf, so
make install will find it and do Good Things.
PR:
Obtained from:
Submitted by:
Reviewed by: