Bradley Nicholes [Fri, 31 May 2002 17:52:51 +0000 (17:52 +0000)]
Fixed the @exp_cgidir@ replacement value so that it resolves to the correct
location when the AWK file generates the default httpd.conf file for NetWare.
Fix the case where we generate both a 401 and 413 and we go bonkers.
- If an error would drop the connection, we do not return the top-level
error anymore as we will assume this new one takes precedence over the
original error. This also ensures that we will not read the input
body (which is the point of returning these special error messages in
the first place).
- The ap_discard_request_body return value in ap_die() must be checked
to make sure we don't encounter this recursive case and print two errors.
Kudos to Jeff Trawick for his sample input which pointed this out.
Fix the case where if there is no ErrorDocument specified for an error,
the error would be sent to the client *twice* because both the filter
and the core would trigger error responses.
The problem is that the filters have already handled some errors (say 413)
and due to the ap_get_client_block API, the error was morphed into 400.
Therefore, ap_discard_request_body must use brigades directly rather than
the ap_get_client_block API so that any potential errors are not dropped.
The special value AP_FILTER_ERROR indicates that the lower level has
already dealt with this problem (ap_die() will realize this). Otherwise,
we'll error with HTTP_BAD_REQUEST and ap_die() will take it from there.
This also prevents needless memory copies when we are just going to
discard it anyway.
Thanks to Cliff Woolley who found this wacky problem.
Cliff Woolley [Fri, 31 May 2002 05:03:09 +0000 (05:03 +0000)]
fix some major badness: error buckets *cannot* use simple_copy because
they're not simple buckets. they have a private data structure which
gets freed. if you're going to copy them and share whatever ->data points
to (which is what simple_copy does), you have to refcount the structure,
which is the whole point of apr_bucket_refcount and apr_bucket_shared_copy.
Removing mod_bucketeer from the output filters seems to be the cure. Why?
So, this isn't a showstopper since no one will enable bucketeer in
production.
Aaron Bannert [Fri, 31 May 2002 00:23:34 +0000 (00:23 +0000)]
This fixes a failed assert when r->remaining is left in a negative
state and we hit some other error (like permission failure) causing
an internal redirect causing us to reevaluate the input buffers
(for discarding the request body).
- Fix case where the initial chunk length was 0 was not handled correctly.
- Fix bucket lifetimes so that they don't live longer than their brigades.
That's not nice.
- Simplify some usage of f->r->connection to f->c in the bucket creation
calls.
Cliff Woolley [Thu, 30 May 2002 22:39:08 +0000 (22:39 +0000)]
This definitely gets the award for least useful error message of the month.
Not only should it just say "can't do that on win32," which is after all
the bottom line, it was spitting out openssl error messages which were
totally useless. Eg:
[30/May/2002 17:31:17 05760] [error] Init: PassPhraseDialog BuiltIn not
supported in server private key from file
F:/Apache/Apache2/conf/ssl/secure.key (OpenSSL library error follows)
[30/May/2002 17:31:17 05760] [error] OpenSSL: error:0D084069:asn1
encoding routines:d2i_ASN1_SET:bad tag
[30/May/2002 17:31:17 05760] [error] OpenSSL: error:0D09D082:asn1
encoding routines:d2i_RSAPrivateKey:parsing
[30/May/2002 17:31:17 05760] [error] OpenSSL: error:0D09B00D:asn1
encoding routines:d2i_PrivateKey:ASN1 lib
Which is essentially saying "OpenSSL couldn't read your private key because
it was encrypted, and we can't get the passphrase the way you asked us to
on this platform."
Brought to my attention by the inquiry of: Chris Hsiang <chsiang@ivivos.com>
Thanks for verifying these are valid, Doug. Now this [much shorter]
list should be living in our STATUS file. Question of module maps
and file layout is already off to the list.
Add a PROXYREQ_RESPONSE value for request_rec->proxyreq because it is
possible that there can be different behavior at the protocol level if
request_rec isn't really a request but a response.
This stems from the fact that request bodies must be indicated by
Content-Length or Transfer-Encoding, but response bodies do not. The
recent change to ap_http_filter to return EOS if there isn't a body broke
proxy. Therefore, there must be some way for the proxy to indicate that
this is a response. Accordingly, ap_http_filter can allow the BODY_NONE
iff this is a response.
Since r->proxyreq is set to PROXYREQ_PROXY even for the original request
from the client, that value isn't sufficient. Hence, the introduction of
PROXYREQ_RESPONSE.
Cliff Woolley [Thu, 30 May 2002 05:57:33 +0000 (05:57 +0000)]
Imagine the horror. I go to try compiling PHP4, and it bombs out on
r->boundary. BUT WAIT, I say, we have a test in there for that:
#if !MODULE_MAGIC_AT_LEAST(20020506,0). The test doesn't seem to be
working. That's odd, I think. So I go look at the ap_mmn.h. Egad,
the tests are totally backwards. How on earth are we going to handle this?
Surely it's wrong in 1.3.x as well. So I go look. Nope, turns out it
got fixed TWO YEARS AGO in that repository. Sigh. Anyway, thanks Greg.
:)
Apply same patch to mod_cgid that was applied to mod_cgi so that it
bypasses the *_client_block calls in favor of using the input filters
and brigades directly.
Cliff Woolley [Thu, 30 May 2002 05:04:32 +0000 (05:04 +0000)]
Yet another reason the MMN needs to get bumped. If there are changes
that anyone's been holding off on because they would affect the MMN, might
as well get them in now so we minimize the number of releases with MMN
changes. I believe there are more renames pending in APR that should be
done sooner rather than later, for example.
Cliff Woolley [Thu, 30 May 2002 00:35:25 +0000 (00:35 +0000)]
Thanks Ryan for cleaning up after my laziness. :) Here are just a few
last little changes. ->datafile should be initialized... but doing so
brings up the fact that the check in run_rewritemap_programs() was
expecting ->datafile to have a string attached to it. For clarity,
let's just use argv[0] there. And since we've reinstated the use of
->checkfile, we no longer need that extra apr_stat() I hacked in,
so let's get rid of it.
Ryan Bloom [Thu, 30 May 2002 00:02:59 +0000 (00:02 +0000)]
Tokenize the arguments for rewrite programs during config parsing, and
just use that information later. I was having a problem with prg
directives with arguments failing the configuration. The problem was
a call to stat, which was being passed the program name and the arguments.
Obviously, the arguments were messing up the call to stat. This gets the
test suite working for me again.
Solve a bug identified by Sebastian that we would always reaquire the
lock immediately instead of stalling for the isapi module's thread
to complete its work. This requires the new changes to thread_mutex
that introduce a guarenteed APR_THREAD_MUTEX_UNNESTED flag.
Reported by: Sebastian Hantsch <Sebastian.Hantsch@t-online.de>
Add a note indicating what it would take to get MTIME field populated.
(I did this locally, but didn't figure it was worth committing, but it's
still worth noting.)
Allow mod_deflate to be more tolerant of multiple content-encodings.
- Tighten scope of a few affected variables (accepts, token).
- Look for gzip in r->headers_out (!) - if there, we've already compressed.
(Previously, we'd look at r->headers_in which was bogus - we're output.)
- Switch the Accept-Encoding check to be case-insensitive per RFC 2616.
- Remove commented-out code.
- If C-E wasn't present or it was just "identity," set C-E to "gzip",
otherwise, merge "gzip" onto the C-E list.
This patch was originally submitted by Ian and cleaned up and tested by
Justin.
Submitted by: Ian Holsman
Reviewed by: Justin Erenkrantz
Cliff Woolley [Wed, 29 May 2002 04:38:59 +0000 (04:38 +0000)]
Error out a bit more nicely if the RewriteMap prg: is not found. We
can't just apr_stat in the first init round because we haven't run
apr_tokenize_to_argv() yet, and it would be a relatively ugly hack to run
it twice just for that. Well, I suppose we could store the argv in the
rewritemap structure, but ... nah. With this, we shutdown (cleanly, as
opposed to the old exit(1) method) if we go to execute a rewritemap
and discover it doesn't exist, and log a nice descriptive message at the
end of the error_log.
Correctly return 413 when an invalid chunk size is given on input.
- If get_chunk_size() returns a negative number, that probably implies
an overflow. So, create a 413 error and pass it to the output filters.
- Modify ap_discard_request_body() to return OK quickly if we're a subreq
or our status code implies that we will be dropping the connection.
- Modify ap_die() so that if the new status implies that we will drop
the connection, that we correctly indicate that we can not keepalive
this connection. (Without this, the error is returned, but the connection
is not closed.)
Cliff can revoke this as a showstopper, but I think this'll get fixed as soon
as I (or someone else) figures out how to return HTTP errors from a filter.