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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100801 13f79535-47bb-0310-9956-ffa450edef68
- use switch instead of if-else chain
- collapse txt/rnd code, which is essentially the same
- make it better readable at all.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100795 13f79535-47bb-0310-9956-ffa450edef68
reorder the code in mod_rewrite.c in order to get a rid of
the forward declaration. Cleaned up the comments as well.
No real code change, but a quite big diff ...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100792 13f79535-47bb-0310-9956-ffa450edef68
The generic flagparser (read: lexer) for RewriteRules and RewriteConds
does the same except for one function call.
Collapse these to functions to one and make the result more
readable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100772 13f79535-47bb-0310-9956-ffa450edef68
of baking our own. The core function is much better maintained
and probably more safe.
Additionally this removes just another fixed buffer :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100681 13f79535-47bb-0310-9956-ffa450edef68
+ give it a better interface
+ get a rid of most of the fixed stack buffers and then
+ no longer limit rewritten uris, expanded variables etc to
2k
+ make it better readable and understandable at all.
This is a two-tiered commit for better diffs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100675 13f79535-47bb-0310-9956-ffa450edef68
- add comment about what subst_prefix_path function does
- reduce the use of fixed buffers
- get a rid of unnecessary memory operations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100650 13f79535-47bb-0310-9956-ffa450edef68
unixd_set_global|proc_mutex_perms(). Allow the functions to be
called for any type of mutex.
This resolves a fatal problem with mod_rewrite on systems where
APR uses flock-based mutex.
It simplifies mod_ssl as well, which had special logic to perform
the chown(). It fixed an init error with mod_ssl on systems where
flock is used when the user had no SSLMutex directive.
The Unix MPMs continue to call unixd_set_global|proc_mutex_perms()
only for SysV sems. There is no permission problem with flock-based
accept mutexes since the child init logic for the MPMs is done
prior to switching identity.
PR: 20312
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100189 13f79535-47bb-0310-9956-ffa450edef68
aborting after exceeding a limit of internal redirects. The
limit defaults to 10 and can be changed using the RewriteOptions
directive with the new MaxRedirects=n argument.
(The latter required some restructuring of the RewriteOptions
evaluation code).
(Documentation patch follows asap)
PR: 17462
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98863 13f79535-47bb-0310-9956-ffa450edef68
programs (RewriteMap prg:/something).
the wrong field was specified when trying to log the name of
the program that couldn't be started
recent APR features used to provide better error reporting
on systems where apr_proc_create() uses fork()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98840 13f79535-47bb-0310-9956-ffa450edef68
- uris were partially not correctly escaped (in particular:
ldap, news, mailto)
- not all uri schemes contain an authority component (//)
- add nntp:// scheme
- don't add a query string (and drop r->args) if it's not
http or mailto scheme
- be more efficient (think so)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98808 13f79535-47bb-0310-9956-ffa450edef68
It fixes the misunderstandings between local URL paths and local
system paths. Note that mod_rewrite handles _both_.
Fixed also some comments to make the explanations more clear.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98783 13f79535-47bb-0310-9956-ffa450edef68
It fixes the prefix_stat function. (which does a stat call on the first
path segment). This function was still tailored for unix systems only.
It should work on other systems as well now.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98782 13f79535-47bb-0310-9956-ffa450edef68
for better understanding, what I'm doing there. This is part one.
mod_rewrite appears to be very broken in several cases, especially on
non-unix systems. However, let's start with fixing the path handling, since
it's _the_ major PITA, e.g. on win32.
This part removes _unused_ code. The condition is never true, because
"A local rewrite in per-directory context" was caught much earlier.
I'd guess this piece of code was c&p accidentally...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98781 13f79535-47bb-0310-9956-ffa450edef68