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

368 Commits

Author SHA1 Message Date
Graham Leggett
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Graham Leggett
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
Jim Jagielski
2d56c9ab05 No longer do double duty...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175979 13f79535-47bb-0310-9956-ffa450edef68
2011-09-26 18:12:38 +00:00
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
4ce184aeb0 replace non-threadsafe use of srand() and rand() with ap_random_pick()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171251 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 19:55:56 +00:00
Eric Covener
e74e7f6322 Prevent a crash if a non-existent internal RewriteMap is specified
in a server context with RewiteEngine off, then later referenced.

Submitted By: Ben Noordhuis
Reviewed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154808 13f79535-47bb-0310-9956-ffa450edef68
2011-08-08 02:29:39 +00:00
Stefan Fritsch
481fac5ce2 Make the SERVER_NAME variable include [ ] for literal IPv6 addresses, as
mandated by RFC 3875

PR: 26005


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147614 13f79535-47bb-0310-9956-ffa450edef68
2011-07-17 13:56:28 +00:00
Stefan Fritsch
832670d8b2 Fix regexp RewriteCond with NoCase,
reported by Steffen <info apachelounge com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1143541 13f79535-47bb-0310-9956-ffa450edef68
2011-07-06 20:07:56 +00:00
Stefan Fritsch
46d4791a5d Add string valued expressions to ap_expr, do some API cleanup
- add possibility to have expressions that evaluate to a string and not to
  a boolean value
- modify ap_expr_parse_cmd() interface to support this and make it more
  convenient to use in general
- rename AP_EXPR_FLAGS_* to AP_EXPR_FLAG_* for consistency


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142164 13f79535-47bb-0310-9956-ffa450edef68
2011-07-02 07:45:00 +00:00
Stefan Fritsch
51692222f6 Various code cleanup
PR: 51398
Submitted by: Christophe Jaillet <christophe jaillet wanadoo fr>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138627 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 20:45:34 +00:00
Stefan Fritsch
255f723fef We already have ap_str_tolower(), so also add ap_str_toupper() function and use
it where possible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138617 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 20:24:27 +00:00
Jim Jagielski
2e655b0b63 revert this... sorry
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1136966 13f79535-47bb-0310-9956-ffa450edef68
2011-06-17 18:14:45 +00:00
Jim Jagielski
213dda7d09 Revert "fix unexpected enum operation"
This reverts commit d407a566ab24e576a3f143f5c27b2ccf90f5d8da.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1136946 13f79535-47bb-0310-9956-ffa450edef68
2011-06-17 17:15:54 +00:00
Jeff Trawick
554b49c5fe fix unexpected enum operation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1136096 13f79535-47bb-0310-9956-ffa450edef68
2011-06-15 15:51:57 +00:00
Stefan Fritsch
48345b21d0 Avoid some memory allocations by using apr_table_setn where the string arguments
are allocated from the request pool and not modified later on.

Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51358


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135084 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 11:04:29 +00:00
Stefan Fritsch
feca55db60 - Introduce concept of context prefix (which is an URL prefix)
and context document root (which is the file system directory that
  this URL prefix is mapped to). This generalization of the document
  root makes it easier for scripts to create self-referential URLs and
  to find their files.
- Expose CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX as envvars, in mod_rewrite,
  and in ap_expr.
- Make mod_alias and mod_userdir set the context information.
- Allow to override the document root on a per-request basis. This allows
  mass vhosting modules to set DOCUMENT_ROOT correctly.
- Make mod_vhost_alias set the per-request document root

PR: 26052, 46198, 49705

Remaining tasks:
- Use the context document root & prefix in mod_rewrite to make RewriteBase
  unneccessary in many cases. Do this without breaking compatibility.
- Write docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132494 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 21:33:12 +00:00
Stefan Fritsch
2014acf62f Improvements found by cppcheck:
remove some unused variables and dead assignments, reduce the scope of some
variables, add some parens to improve readability


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103459 13f79535-47bb-0310-9956-ffa450edef68
2011-05-15 16:58:45 +00:00
Jeff Trawick
782c711893 fix some dead assignments found by the clang analyzer
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1098162 13f79535-47bb-0310-9956-ffa450edef68
2011-04-30 21:18:58 +00:00
Stefan Fritsch
3508ccf5a5 Report filename and line number in config warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096551 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 18:28:34 +00:00
Jeff Trawick
562c645ad6 change signed single-bit fields to unsigned
some of these were exposed to mods so the mmn is bumped, without
regard to whether any compiler will have to generate different
code


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086662 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 18:20:52 +00:00
Rich Bowen
30fa792204 Or, perhaps that's even clearer, without getting too verbose.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084714 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 20:11:43 +00:00
Rich Bowen
7e9a6ee3c2 Attemps to clarify a rather cryptic error message.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084698 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 19:49:02 +00:00
Graham Leggett
4be5710bbe mod_rewrite: Decline immediately if the rewrite engine is disabled, instead
of making various comparatively expensive proxy checks first.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081197 13f79535-47bb-0310-9956-ffa450edef68
2011-03-13 19:05:39 +00:00
Stefan Fritsch
385da96d50 Use ap_state_query() to fix many modules that were not correctly initializing
if they were not active during server startup but got enabled later during a
graceful restart (in which case they need to do all work during a single
config run).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070153 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 21:23:56 +00:00
Stefan Fritsch
6c6979ede6 Make the REQUEST_SCHEME variable available to scripts and mod_rewrite
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053872 13f79535-47bb-0310-9956-ffa450edef68
2010-12-30 12:34:19 +00:00
Ruediger Pluem
abcc9f0497 * Silence compiler warning about possibly uninitialized use
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053814 13f79535-47bb-0310-9956-ffa450edef68
2010-12-30 07:41:18 +00:00
Stefan Fritsch
95216d3918 Allow to use arbitrary boolean expressions (ap_expr) in RewriteCond.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053750 13f79535-47bb-0310-9956-ffa450edef68
2010-12-29 21:48:35 +00:00
Stefan Fritsch
6c6d387525 in struct backrefinfo: remove nsub member which is never read,
make source member const


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053742 13f79535-47bb-0310-9956-ffa450edef68
2010-12-29 21:22:33 +00:00
Stefan Fritsch
7f6106542e Allow to unset environment variables using E=!VAR.
PR: 49512
Submitted by: Mark Drayton <mark markdrayton info>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053726 13f79535-47bb-0310-9956-ffa450edef68
2010-12-29 20:41:55 +00:00
Eric Covener
fce013d234 PR 50447: mod_rewrite escapes the original [escaped] query string even when
you haven't modified it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1044673 13f79535-47bb-0310-9956-ffa450edef68
2010-12-11 16:14:06 +00:00
Eric Covener
47280b5452 PR 39313: allow the user to configure which rules come first when RewriteRules
are merged with RewriteOptions Inherit.

Submitted By: Jérôme Grandjanny <jerome.grandjanny cea.fr> 
Reviewed By: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042255 13f79535-47bb-0310-9956-ffa450edef68
2010-12-04 22:33:46 +00:00
Graham Leggett
3aecbb0543 mod_rewrite: Fix the RewriteEngine directive to work within a
location. Previously, once RewriteEngine was switched on globally,
it was impossible to switch off.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032431 13f79535-47bb-0310-9956-ffa450edef68
2010-11-08 00:41:35 +00:00
Eric Covener
a81eb0d43d Add an END flag to RewriteRule that acts like L=LAST but also prevents
further rounds of rewrite processing due to per-directory substitutions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1028778 13f79535-47bb-0310-9956-ffa450edef68
2010-10-29 14:43:49 +00:00
Stefan Fritsch
8a9e6cd208 return early if we are not logging anyway
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023063 13f79535-47bb-0310-9956-ffa450edef68
2010-10-15 18:36:22 +00:00
Stefan Fritsch
affc4cf328 save some memory by using cmd->temp_pool instead of cmd->pool in some places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002156 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 13:19:33 +00:00
William A. Rowe Jr
e9bdc417d6 Introduce integer comparison support in RewriteCond
The operators -gt, -ge, -eq, -le, -lt and -ne follow the bash test' semantics
for comparing the integer values of the lhs and rhs expressions, as opposed
to the string evaluations performed by > >= = <= and <.

Note that -lt and -le overlap the existing -l test, and could be confused in
expresions such as -ltestfile - to avoid this conflict use -L or -h in place
of the legacy -l file symlink test operator.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997878 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 18:57:23 +00:00
William A. Rowe Jr
fb6d2cd8e2 Reduce complexity and fix a regex.t based on observation by rpluem;
- follow the same logic of '=' for >[=] and <[=], skipping p->type chars
   for the resulting p->pattern
  
 - introduce pskip logic to greatly simplify logging, track negation '!', '=', 
   and new comparators ">/<[=]", backspacing only for the purpose of logging.
   It's trivial to expand this to the -X operators in the future.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997869 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 18:14:32 +00:00
William A. Rowe Jr
1038d34486 *) Accept modern bash test conventions of -h or -L for testing symlinks
(for another patch against -l yet-to-come)

*) Introduce >= and <= syntax for greater-or-equal, or less-or-equal
   string comparisons

*) Respect [NC] conventions for >[=]/<[=] string comparison, which is
   horribly sensitive to the current charset.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997553 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 00:54:58 +00:00
Jeff Trawick
62cb0bdaff set default pattern type using the enum value instead of
integer literal (Intel C compiler groans about this)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@991516 13f79535-47bb-0310-9956-ffa450edef68
2010-09-01 12:43:03 +00:00
Stefan Fritsch
7ffa5cece3 mod_rewrite: Log errors if rewrite map files cannot be opened
PR: 49639


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986921 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 20:35:43 +00:00
Stefan Fritsch
5c22b85454 Remove obsolete "see error log" log messages.
mod_rewrite now uses the error log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986912 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 20:22:51 +00:00
Stefan Fritsch
f0fdf298c3 remove some useless use of strlen()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982017 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:49:21 +00:00
Stefan Fritsch
02dc2d45cf Code cleanup: replace strncpy by apr_cpystrn or apr_pstrmemdup
Submitted by: Takashi Sato <takashi lans tv com>
PR: 43432


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@981086 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 20:08:44 +00:00
Rainer Jung
a52fa4db6d Remove superfluous EOL from mod_rewrite logging.
It's no longer needed, since mod_rewrite now uses
our usual error log. The superfluous EOL was logged
as '\n'.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960236 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03 17:01:23 +00:00
Rainer Jung
60e8f3a913 Allow to set environment variables using mod_rewrite without
explicitely giving a value.

Most modules only check presence of a variable, not the
value, so it makes sense to make the VAL argument in
the mod_rewrite ENV flag optional.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960233 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03 16:21:58 +00:00
Eric Covener
e89325dac5 mod_rewrite.c:447: warning: format not a string literal and no format arguments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953785 13f79535-47bb-0310-9956-ffa450edef68
2010-06-11 17:39:17 +00:00
Stefan Fritsch
a5f4ee1845 Replace RewriteLog/RewriteLogLevel with trace log levels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951903 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:09:43 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
William A. Rowe Jr
01d300298f Catch up with ap_[proc|global]_mutex_create api change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940981 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 17:40:43 +00:00