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.
Stas Bekman [Wed, 6 Aug 2003 04:02:34 +0000 (04:02 +0000)]
these 3 bugs were reported long time ago, but there are still there. The entries
include links to the threads where these bugs were discussed
PR:
Obtained from:
Submitted by:
Reviewed by:
André Malo [Tue, 5 Aug 2003 23:04:05 +0000 (23:04 +0000)]
hook mimetype-forcing into fixup/LAST. This leads to consistent
behaviour (server context vs. directory context), overrides all statically
configured mime types and doesn't clobber multiviews any longer.
Although we initialize mc->pid in the child init phase,
we haven't initialized it before initially performing
our ssl_rand_seed() in the parent/postconfig phase.
André Malo [Mon, 4 Aug 2003 23:43:39 +0000 (23:43 +0000)]
introduce REWRITELOG_DISABLED compiler option, which -- if supplied --
strips all logging code from mod_rewrite. This is meant as a performance
improvement for production sites, not as a recommended compiler option
for public distributions.
At least conceptionally this was
Reviewed by: Justin Erenkrantz, Mads Toftum, Thom May,
David Burry <dburry@tagnet.org>
André Malo [Mon, 4 Aug 2003 21:47:08 +0000 (21:47 +0000)]
improve expansion performance.
If we have only small expansions (like just one variable - often used
in map keys or the like), don't stress the pool with allocating
memory for the linked result pointer list. This list can be safely
stored on the stack.
Joshua Slive [Mon, 4 Aug 2003 16:50:44 +0000 (16:50 +0000)]
Remove the general not-updated warning for perf-tuning,
since the document is mostly accurate. But since the
accept-mutex section seems a little dated, leave a
warning there. That could use some developer intervention.
Also, remove the author attribution, since large parts
of this have changed since Dean wrote it.
André Malo [Sun, 3 Aug 2003 19:04:54 +0000 (19:04 +0000)]
cleanup the add_cookie function a bit.
- the if(s) check is superfluid. s is guaranteed to be non-NULL
(except for out of memory)
- strtok as late as possible to save some cycles.
André Malo [Sun, 3 Aug 2003 18:38:14 +0000 (18:38 +0000)]
incorporate the add_env_variable function in do_expand_env.
I see no real reason to use an extra function call here (other than
decreasing performance :)
Jeff Trawick [Fri, 1 Aug 2003 10:41:46 +0000 (10:41 +0000)]
distinguish between these two states:
. just issued connect(), polling for writability to find out when connect()
completed
. already connected, waiting for data from the server so polling for
readability
by only polling for writability during the first state, we avoid some
logic in test() which inappropriately writes multiple requests to the
server
btw, the most basic SSL test segfaulted before and after this commit
André Malo [Wed, 30 Jul 2003 17:19:36 +0000 (17:19 +0000)]
cleanup RewriteCond evaluation.
- avoid unnecessary memory operations
- parse non-regex patterns at configuration time, which
- gives the ability to throw a useful warning, where [NC] is not supported
- and speeds up processing at runtime
- allow [NC] for simple comparison pattern (=)
- improve readability
André Malo [Wed, 30 Jul 2003 13:37:36 +0000 (13:37 +0000)]
Rewritemap improvement:
- map designations are now case insensitive (txt: rNd: PRG: INt:)
- maps may be relative to serverroot, which appears to be _very_
helpful
André Malo [Tue, 29 Jul 2003 20:58:29 +0000 (20:58 +0000)]
speed up variable lookup. It's expected to be faster
than a hash (and the previous if-else chain, of course).
This also reverts the wrong patch, committed in r1.151
Standardize on example.com names, never bogus your-server.name style
entries. Roy attacked this recently, but apparently there are some
holdovers or reversions to this policy.