1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

336 Commits

Author SHA1 Message Date
Sander Striker
67a3a71877 Fold in the CAN-2003-0542 regex patch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101556 13f79535-47bb-0310-9956-ffa450edef68
2003-10-24 16:20:28 +00:00
Martin Kraemer
18a48592ca Match type of both arguments (get rid of compiler warning) in x ? y : z expression
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101357 13f79535-47bb-0310-9956-ffa450edef68
2003-09-30 15:22:41 +00:00
Jeff Trawick
aa21671e13 switch to APR 1.0 API (which is still in flux)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68
2003-09-03 19:27:12 +00:00
André Malo
a595a2ab93 style
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101029 13f79535-47bb-0310-9956-ffa450edef68
2003-08-20 01:11:11 +00:00
André Malo
642b716160 allow [T=...] forced types to get expanded.
PR: 14223


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101028 13f79535-47bb-0310-9956-ffa450edef68
2003-08-20 00:35:48 +00:00
André Malo
9a2bf077df cleanup apply_rewrite_rule function.
Improve readablity (? ;-) and efficiency.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101027 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 22:37:38 +00:00
André Malo
e2f7f084ff rename the exp_ctx to rewrite_ctx and widen its scope. That makes
a lot of things easier :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101026 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 20:11:32 +00:00
André Malo
88d62b963a stressing the notes table is not necessary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101025 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 18:21:30 +00:00
André Malo
62057a6279 Catch an edge case, where strange subsequent RewriteRules
could lead to a 400 (Bad Request) response. Example:

<Directory /path>
    RewriteEngine on
    RewriteBase /
    RewriteRule foo /bar
    RewriteRule bar baz
</Directory>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101012 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 00:52:43 +00:00
André Malo
9de220654a 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.

Related to PR 8493.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101011 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 00:36:58 +00:00
André Malo
01cda7f81b doh. the permission thing is independent from rewrite log
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101010 13f79535-47bb-0310-9956-ffa450edef68
2003-08-18 21:57:45 +00:00
André Malo
cb9196494d use a context structure to hold expansion information. This makes some
things easier (in future commits :-)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101009 13f79535-47bb-0310-9956-ffa450edef68
2003-08-18 21:52:22 +00:00
André Malo
dc08a711e9 remove superfluous (heya Cliff) space from log string.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100914 13f79535-47bb-0310-9956-ffa450edef68
2003-08-06 00:15:49 +00:00
André Malo
3926652e28 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100913 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 23:04:05 +00:00
André Malo
127a0cee1e add a comment for future editors
no code change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100911 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 21:18:47 +00:00
André Malo
b1b5201ed2 There are different kinds of people:
- the good      English speaking people
- the bad       English speaking people
- and the ugly  ones, who should not even try to do so

I think, I'm one of the latter group.
Thanks to Thom May :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100907 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 18:45:53 +00:00
André Malo
507b868253 word smithing / grammar
Submitted by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100906 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 17:44:02 +00:00
André Malo
4f2835b6a2 make clear, that we *know* the RewriteLog directive, even if we
don't support it. Thanks to kess for pointing this out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100905 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 12:12:21 +00:00
André Malo
2571aaa8bf 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100904 13f79535-47bb-0310-9956-ffa450edef68
2003-08-04 23:43:39 +00:00
André Malo
7abc0c4dbe remove unneccessary assignment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100902 13f79535-47bb-0310-9956-ffa450edef68
2003-08-04 22:05:43 +00:00
André Malo
7634e76546 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100901 13f79535-47bb-0310-9956-ffa450edef68
2003-08-04 21:47:08 +00:00
André Malo
bc6739419e cleanup compare_lexicography function.
- improve readability
- make sure that unsigned chars are compared
- use apr_size_t for string lengths


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100895 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 20:15:50 +00:00
André Malo
f79b211864 inline some functions for faster processing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100894 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 19:50:26 +00:00
André Malo
57cf2330b2 subreq_ok *is* a macro.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100893 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 19:14:55 +00:00
André Malo
b209affe98 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100892 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 19:04:54 +00:00
André Malo
a281ae2118 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 :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100891 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 18:38:14 +00:00
André Malo
f1c173bab8 style
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100890 13f79535-47bb-0310-9956-ffa450edef68
2003-08-03 17:59:55 +00:00
André Malo
e52a2fbb27 gcc doesn't catch the logic and throws a warning about uninitialized
fname. Get a rid of it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100877 13f79535-47bb-0310-9956-ffa450edef68
2003-07-31 16:56:28 +00:00
André Malo
8a8987c741 remove some unnecessary memory operations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100870 13f79535-47bb-0310-9956-ffa450edef68
2003-07-30 21:04:31 +00:00
André Malo
1a5a76127b remove artifical limitation of number of env and cookie flags
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100869 13f79535-47bb-0310-9956-ffa450edef68
2003-07-30 20:55:35 +00:00
André Malo
8392b2b9bb 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100862 13f79535-47bb-0310-9956-ffa450edef68
2003-07-30 17:19:36 +00:00
André Malo
2ae7b9c92f Rewritemap improvement:
- map designations are now case insensitive (txt: rNd: PRG: INt:)
- maps may be relative to serverroot, which appears to be _very_
  helpful


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100860 13f79535-47bb-0310-9956-ffa450edef68
2003-07-30 13:37:36 +00:00
André Malo
9567dd0c34 cleanup parseargline function to be more efficient and better readable.
It's a quite strange function. I think we can drop it at all. Opinions
anywhere?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100857 13f79535-47bb-0310-9956-ffa450edef68
2003-07-30 00:13:01 +00:00
André Malo
005f44cd4a cleanup expand_tildepath function to use the pool and be more
readable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100855 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 22:19:55 +00:00
André Malo
3b799c3515 minor optimization: the bracket search functions just search
for curly brackets, so there's no need to supply that every
time again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100853 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 21:37:59 +00:00
André Malo
4671e78173 this was a two-tiered commit for better diffs.
Now bust the old function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100851 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 21:01:37 +00:00
André Malo
241e588ba4 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100850 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 20:58:29 +00:00
André Malo
2bed74f80c cause a lookup failure in external rewrite maps if
the key contains a newline.

PR: 14453
Submitted originally by: Cedric Gavage <cedric.gavage@unixtech.be>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100833 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 01:14:17 +00:00
André Malo
a896aefcb2 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100832 13f79535-47bb-0310-9956-ffa450edef68
2003-07-29 00:33:13 +00:00
André Malo
0ffc7de65d - style & readability
- procattr_cmd_type_set was called twice. shoot one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100831 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 23:41:18 +00:00
André Malo
09566024b1 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100830 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 23:06:54 +00:00
André Malo
caa64178e4 cleanup fully_qualify_uri function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100829 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 22:48:51 +00:00
André Malo
30ee441248 cleanup splitout_queryargs function.
- don't compute strlen more than one time
- use ap_strchr instead of strchr


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100828 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 21:59:43 +00:00
André Malo
008aaa8136 cleanup rewritelog function.
- shorten the code
- improve efficiency and readability
- get a rid of fixed buffers
- use %pp format string for pointers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100827 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 21:31:06 +00:00
André Malo
1518b86739 allow piped rewrite logs to be relative to serverroot
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100818 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 15:32:27 +00:00
André Malo
45e7561f3d exit(1) should never occur in any module. Stay away from it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100814 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 14:53:32 +00:00
André Malo
c9828a5a37 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100813 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 14:18:45 +00:00
André Malo
ed491cbf6b 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).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100810 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 13:02:37 +00:00
André Malo
4f21346032 add the ability to change the maximum txt:map line length at
compile time without patching the code


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100809 13f79535-47bb-0310-9956-ffa450edef68
2003-07-28 12:30:42 +00:00
André Malo
d4b1817c38 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100801 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 22:12:49 +00:00