Resolve the ap_get_client_block() showstopper by looking at APR_BRIGADE_LAST
of what we get from ap_get_brigade and set a nugget for our next call to
pick up on.
Cliff Woolley [Thu, 28 Aug 2003 05:54:44 +0000 (05:54 +0000)]
Updated the various MPM's to use the new bucket_alloc_create_ex API
when necessary. Which is to say that it's necessary in all cases except
for prefork, where the change to apr-util to have it use the allocator
from the pool passed in is already sufficient.
Cliff Woolley [Thu, 28 Aug 2003 05:41:32 +0000 (05:41 +0000)]
axe some warnings:
mod_dav_lock.c:72: warning: no previous prototype for `dav_generic_get_lockdb_path'
locks.c: In function `dav_generic_really_open_lockdb':
locks.c:356: warning: unused variable `db'
locks.c: In function `dav_generic_load_lock_record':
locks.c:606: warning: unused variable `buf'
locks.c: In function `dav_generic_remove_lock':
locks.c:1081: warning: unused variable `buf'
André Malo [Thu, 28 Aug 2003 01:13:11 +0000 (01:13 +0000)]
cleanup the TOKEN_AND/OR tree generation code.
- check more exactly whether the previous token is correct
- flip the tree from left-weighted to right-weighted, which is
more natural and more efficient, since we don't need to loop
up to the root, but just until the next and/or token.
- that way, flip the short circuit evaluation again to cut
the right side now if possible...
André Malo [Wed, 27 Aug 2003 20:26:28 +0000 (20:26 +0000)]
hrm. reverting my last commit. TOKEN_GROUP is a protection against many
invalid expressions. Checking these all manually would take a lot more
cycles than it'd save. Sorry.
André Malo [Wed, 27 Aug 2003 19:32:35 +0000 (19:32 +0000)]
TOKEN_GROUP is nothing but an identity operator, it gateways the
result of the enclosed expression. Since this expression will never
touched again during the tree-building stage, we can safely strip
TOKEN_GROUP from the tree and later evaluate the child directly.
The only side effect of this change is, that grouped strings on the
left side of EQ/NE/etc are now allowed (was invalid before), which
is acceptable IMHO (e.g. (foo bar baz) = zzzip)
André Malo [Wed, 27 Aug 2003 18:00:47 +0000 (18:00 +0000)]
cleanup TOKEN_EQ, NE, LT & co tree generator:
- the left side of such an operator can *only* be a string
- get a rid of the while-loop and re-organize the code
to better reflect what we're actually doing there
André Malo [Tue, 26 Aug 2003 00:32:03 +0000 (00:32 +0000)]
since our parse tree is left-weighted, the short circuit evaluation
is way more useful if we short circuit the left side. So evaluate
the right side first. This, however, reverses my statement about
regex optimization (you have to put them onto the right side of an
&& or || operator to get a chance that the left side will be cutted).
André Malo [Mon, 25 Aug 2003 22:06:45 +0000 (22:06 +0000)]
readability improvement. Handle the case of the current token being the
first parsed explicitly. There's probably also a minor performance improvement
on invalid expressions ... ;-)
André Malo [Mon, 25 Aug 2003 16:05:13 +0000 (16:05 +0000)]
short circuit && and || evaluation. For backwards compat this is only
possible if there's no regex on the short circuited side (since it fills
in the backref data). The user may optimize this by putting the regex
onto the left side of the operator.
André Malo [Mon, 25 Aug 2003 03:30:50 +0000 (03:30 +0000)]
if the tokenizer hits a string which begins with a backslash, this
backslash will be skipped and not recognized as an escape character.
That way, <!--#if expr="\)"--> or the like won't work correctly.
Fix it now.
André Malo [Mon, 25 Aug 2003 00:16:04 +0000 (00:16 +0000)]
Ha! Wrote this combined tree dumper and consistency checker just for fun.
...and saw that the expression parser generates inconsistent trees under
some circumstances. So I've decided that the dumper code may be of public
interest :). The actual bugfixes will follow later.
Fixup IPv6 Listen statements on Linux by attempting to bind in the order
that getaddrinfo() returned to us and skipping binding to IPv4 addresses
if the previous bind was to an IPv6 of the same address and port.
Justin made some style changes, added a (struct in6_addr*) to make it compile
on *BSD as well as an attempt to make the addition of the listener to the list
a little more efficient.
André Malo [Sun, 24 Aug 2003 00:25:42 +0000 (00:25 +0000)]
cleanup the conditional expression parser for
- improved efficiency and memory footprint
- improved readability
- style
This includes an overhaul of the debugging macros, mostly
that they are not always in the way if one tries to understand
the code ;-)
André Malo [Sat, 23 Aug 2003 03:53:34 +0000 (03:53 +0000)]
don't waste memory, if someone configures another error message or
timeformat during runtime. The common case doesn't need max_string_len
at all and won't be configured more than one or two times.
André Malo [Sat, 23 Aug 2003 03:27:51 +0000 (03:27 +0000)]
overhaul of ap_ssi_parse_string
- improve efficiency and memory footprint (don't use the power-of-two
allocator)
- allow the combination of out = NULL && length = 0, which means that
the resulting expansion is unlimited in length
André Malo [Thu, 21 Aug 2003 22:01:34 +0000 (22:01 +0000)]
bump mod_include's external API. The API is now more simple and expected
to be better extensible without breaking binary compatibility, since an
opaque pointer to internal structures is part of the public context.
(We can easily add APi functions that operate on this internal struct).
I've tried to keep this change as small as possible - sorry for the big
diff though, but the commit should be atomic. mod_cgi and mod_cgid won't
compile until the next commit, anyway.
André Malo [Wed, 20 Aug 2003 16:27:18 +0000 (16:27 +0000)]
major overhaul of mod_include's filter parser. Note that the new code
contains a thin wrapper to ensure binary compatibility. (needed for
2.0 backport).
This is a two-tiered commit for better diffs. This one inserts the new
code (old code #if'd out).
André Malo [Tue, 19 Aug 2003 14:56:12 +0000 (14:56 +0000)]
here applies the same. Don't skip the \0 delimiter when searching
for already applied encodings. Additionally don't compress if *any*
non-identity encoding was applied before. (deflate, pkzip, whatever).
André Malo [Tue, 19 Aug 2003 12:26:38 +0000 (12:26 +0000)]
Doh. If Accept-Encoding contains no gzip token, we skip the 0 delimiter
and search for "gzip" somehwere in the memory. This was originally discovered
by Joe Orton. But there's more. We must skip any parameters, since these
do not contain what we're looking for.
André Malo [Tue, 19 Aug 2003 00:36:58 +0000 (00:36 +0000)]
Fix LA-U and LA-F lookups in directory context. Previously
the current rewrite state was just used as lookup path, which lead to
strange and often useless results.
- Remove the default_family declaration as it is no longer used.
- Fix segfault if checking NULL sa->hostname.
- Cycle through the bind_addr list if we get an error creating an IPv6 socket
and we're IPv6 enabled and the binding address is NULL. The odds are that
we just can't support IPv6. (The twist is that apr_sockaddr_info_get should
return bind_addr's for IPv6 and IPv4. This strikes me as slightly more
elegant than the find_default_family hack.)
This should get us working on Linux and Netware again.
Correct failure with Listen directives on machines with IPv6 enabled by
removing find_default_family() and letting APR determine what should be done
without a hostname.
This patch requires the corollary APR patch to properly call getaddrinfo().
(Justin modified Colm's patch to always walk the old listeners even when
we have an address. That part of the patch wasn't really relevant.)
Cliff Woolley [Tue, 12 Aug 2003 20:58:53 +0000 (20:58 +0000)]
Make mod_ssl consistent with itself when you have a halfass install of
openssl-engine (ie, you're missing the headers). ssl_cmd_SSLCryptoDevice()
is thrown away by the preprocessor if you're missing the header, so the
call to it should have the same condition applied. otherwise, mod_ssl
will fail to link.
Stas Bekman [Tue, 12 Aug 2003 17:46:29 +0000 (17:46 +0000)]
Fix bug in mod_deflate, which was passing calling deflate()
without checkinig first whether it has something to deflate. (currently
this causes deflate to generate a fatal error according to the zlib spec).
PR 22259.
PR:
Obtained from:
Submitted by:
Reviewed by:
Sander Striker [Thu, 7 Aug 2003 23:57:11 +0000 (23:57 +0000)]
Add an error msg when encountering a spoofed identity. If this would
have been here in the first place. Makes issues like these be found
easier in the future.
André Malo [Thu, 7 Aug 2003 16:38:19 +0000 (16:38 +0000)]
split ap_process_resource_config into two functions (since we don't wanna
change the api). Only the first one (the ap_ entry point) now checks
for fnmatch and the second one will be called for every file/directory
included.
This, however, avoids infinite recursions, if a filename contains
wildcard characters.
The fix is to make mod_ssl's check_user_id hook stop tripping
over it's own checks in case of a subrequest. That is, it
should DECLINE in case of a subrequest.