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

371 Commits

Author SHA1 Message Date
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
André Malo
b863e3a2db cleanup the select_random_value_part function.
improve efficiency and readabilty.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100800 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 19:18:27 +00:00
André Malo
6077bd9bb2 cleanup lookup_map_dbmfile function.
improve efficiency and readablity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100798 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 14:40:52 +00:00
André Malo
dfdc32155d cleanup lookup_map_txtfile function.
- improve efficiency
- make it better readable


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100797 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 13:49:15 +00:00
André Malo
13c0dfe406 avoid unnecessary memory operations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100796 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 11:56:06 +00:00
André Malo
0d14f55e88 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100795 13f79535-47bb-0310-9956-ffa450edef68
2003-07-27 00:08:21 +00:00
André Malo
80bbbe3d5e 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).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100794 13f79535-47bb-0310-9956-ffa450edef68
2003-07-26 23:04:18 +00:00
André Malo
18ae486705 re-add missing headers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100793 13f79535-47bb-0310-9956-ffa450edef68
2003-07-26 20:47:03 +00:00
André Malo
74bf9ef099 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.

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
2003-07-26 20:32:24 +00:00
André Malo
b982623b1d remove outdated and more confusing than helping comment.
no code change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100789 13f79535-47bb-0310-9956-ffa450edef68
2003-07-25 20:07:29 +00:00
André Malo
d352d90db9 avoid unnecessary memory operation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100784 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 23:25:31 +00:00
André Malo
d4bd00d88e remove more unnecessary strlen() operations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100783 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 23:10:29 +00:00
André Malo
46fb97d0db remove another fixed buffer from the stack
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100782 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 22:48:17 +00:00
André Malo
8cc2889e83 indentation. no code change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100780 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 22:24:40 +00:00
André Malo
3ca16bbc4c remove useless post increment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100776 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 20:50:50 +00:00
André Malo
0b3c2f8372 remove more variables from the stack and
increase readability.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100775 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 20:29:19 +00:00