- 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.
(Because people don't necessarily know all the methods that their
server deals with, and because crummy cgi scripts may take
"post" and treat it like "POST" or other similar bad
behavior.)
André Malo [Tue, 29 Jul 2003 00:33:13 +0000 (00:33 +0000)]
minor optimizations in lookup_map_program function.
- make it compile time configurable, how long
a response from a rewrite map prg may be.
- avoid unnecessary memory operations
André Malo [Mon, 28 Jul 2003 23:06:54 +0000 (23:06 +0000)]
integrate the random functions into the select_random_value_part
function. This is the only place where they are needed. It is
not necessary to add extra cycles for function calls here.
André Malo [Mon, 28 Jul 2003 14:18:45 +0000 (14:18 +0000)]
a long time ago ...
REWRITELOCK_MODE wasn't used anymore for ages. In the meantime it defined
the mode of the rewritelog (sic!) file. So fix the misnaming and
use constants for mode and open flags.
André Malo [Mon, 28 Jul 2003 13:02:37 +0000 (13:02 +0000)]
cleanup current_logtime function.
use sizeof where sizeof should be used.
don't compute strlen again and again (use the supplied value
from apr_strftime instead).
André Malo [Sun, 27 Jul 2003 22:12:49 +0000 (22:12 +0000)]
Get a rid of the oversized cache.
The new map-cache consists of a simple two-tiered apr_hash structure.
cachep->maps contains entries for each map, which point to a hash with
the actual values (map->entries).
Each map->entries hash lives in a subpool of cachep->pool.
The mtime is stored per map and if the map expires, we just clear
map->pool and create a fresh map->entries hash structure.
This removes a big chunk of code from mod_rewrite, improves readability and
even the memory footprint of the cache.
André Malo [Sun, 27 Jul 2003 00:08:21 +0000 (00:08 +0000)]
cleanup lookup_map function.
- use switch instead of if-else chain
- collapse txt/rnd code, which is essentially the same
- make it better readable at all.
André Malo [Sat, 26 Jul 2003 23:04:18 +0000 (23:04 +0000)]
rewritemaps are identified by name. Store 'em in a hash rather than
an array. This is more naturally, efficient (mostly) and better
readable.
Leave deep indentations for now (better diff).
André Malo [Sat, 26 Jul 2003 20:32:24 +0000 (20:32 +0000)]
oof. Strip all non-public stuff from mod_rewrite.h and
reorder the code in mod_rewrite.c in order to get a rid of
the forward declaration. Cleaned up the comments as well.