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

77 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
Stefan Fritsch
ca96890328 More ap_pregsub error checking/logging
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198966 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 21:58:52 +00:00
Stefan Fritsch
fe0ac45b8e Remove OID match which was never in a GA releas and is obsoleted by
SetEnvIfExpr with PeerExtList()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180828 13f79535-47bb-0310-9956-ffa450edef68
2011-10-10 08:42:30 +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
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
cafa2aaff5 Fix segfault for loglevel >= trace2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060072 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 20:14:54 +00:00
Stefan Fritsch
b93e49391b Rename ap_expr's typedef names:
ap_expr            ->  ap_expr_t
ap_expr_parse_ctx  ->  ap_expr_parse_ctx_t
ap_expr_eval_ctx   ->  ap_expr_eval_ctx_t
ap_expr_lookup_fn  ->  ap_expr_lookup_fn_t
ap_expr_node_op    ->  ap_expr_node_op_e


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042146 13f79535-47bb-0310-9956-ffa450edef68
2010-12-04 11:22:30 +00:00
Stefan Fritsch
40a7329359 Fix SetEnvIfExpr to work with expressions that do not set the regexp
reference data.
Add some trace logging.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039876 13f79535-47bb-0310-9956-ffa450edef68
2010-11-28 13:01:59 +00:00
Stefan Fritsch
7ec578bc10 Fix segfault on parse error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039789 13f79535-47bb-0310-9956-ffa450edef68
2010-11-27 23:46:57 +00:00
Stefan Fritsch
b6649687a3 More ap_expr updates:
- minor bump for ap_expr_exec_re() introduced in r1037504
- actually commit the changes to allow using backreferences in SetEnvIfExpr
- automatically add the correct entries to the Vary-header if the result of
  an expression evaluation depends on a request header
  (can be turned off by setting the AP_EXPR_FLAGS_DONT_VARY flag)
- set AP_EXPR_FLAGS_DONT_VARY in mod_log_config's conditional logging
- fix various off-by-one errors in req_table_func


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037540 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21 19:51:41 +00:00
Stefan Fritsch
44963dc104 Add SetEnvIfExpr directive to set env var depending on expression.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037137 13f79535-47bb-0310-9956-ffa450edef68
2010-11-20 08:50:46 +00:00
Stefan Fritsch
3037f411c9 use temp_pool for some temporary regexps
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1033145 13f79535-47bb-0310-9956-ffa450edef68
2010-11-09 18:34: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
Jeff Trawick
1477c61e6f odd assortment of spelling fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@947651 13f79535-47bb-0310-9956-ffa450edef68
2010-05-24 14:26:49 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
08c97ba290 No functional change: remove "internal" tab spacing/formatting.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@345053 13f79535-47bb-0310-9956-ffa450edef68
2005-11-16 16:31:25 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Jean-Frederic Clere
821b750b84 C++ comments are not supported by some compilers (ReliantUnix).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@326058 13f79535-47bb-0310-9956-ffa450edef68
2005-10-18 09:24:02 +00:00
David Reid
8a190d75f3 Catch up with the changes to mod_ssl and rename the
function pointer to reflect the change. With this change
this module now builds again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@289968 13f79535-47bb-0310-9956-ffa450edef68
2005-09-18 20:06:27 +00:00
Joe Orton
7e5a401891 * modules/metadata/mod_setenvif.c: Unconditionally include mod_ssl.h.
(setenvif_post_config): Fix prototype fubar.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@224718 13f79535-47bb-0310-9956-ffa450edef68
2005-07-25 12:28:42 +00:00
Martin Kraemer
4c8c573275 Allow extraction of the values of SSL certificate extensions into
environment variables, so that their value can be used by any
module that is aware of environment variables, as in:

  SetEnvIf OID("2.16.840.1.113730.1.13") "(.*) Generated (Certificate)" ca=$1
sets
  ca=TinyCA
if the cert was issued by TinyCA.

Similarly,
  SetenvIf OID("2.16.840.1.113730.1.13") "(.*)" NetscapeComment=$1
will set $NetscapeComment to the whole string.

It is technically allowed to have multiple instances of an extension
field, all with the same oid. In this case, the environment variable
will be set to the list of all fields, separated by commas.

The [PATCH] uses a cross-module call from mod_setenvif to
mod_ssl (the latter may also be missing: in this case the
variable will never be set). It calls a common function
in the ssl module that is also used for the SSLRequire
directive's test.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@220307 13f79535-47bb-0310-9956-ffa450edef68
2005-07-22 12:11:55 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
André Malo
c7031febd3 Fix a bunch of cases where the return code of the regex compiler
was not checked properly. This affects: mod_setenvif, mod_usertrack,
mod_proxy, mod_proxy_ftp and core.

PR: 28218


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103328 13f79535-47bb-0310-9956-ffa450edef68
2004-04-10 13:57:39 +00:00
André Malo
9dc7d9ff58 remove support for Remote_User variable, which never worked at all.
PR: 25725


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102734 13f79535-47bb-0310-9956-ffa450edef68
2004-02-21 18:28:30 +00:00
André Malo
a688f06b19 fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:31:03 +00:00
André Malo
3d75c8c079 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102572 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 12:27:14 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
a9f556c22b catch another edge case
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102437 13f79535-47bb-0310-9956-ffa450edef68
2004-01-28 22:30:19 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
André Malo
c906fa96c9 fix optimizer to not throw away a regex if it stumbles over it.
PR: 24219


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101665 13f79535-47bb-0310-9956-ffa450edef68
2003-11-02 00:36:08 +00:00
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
André Malo
a9ba1fd247 Extend the SetEnvIf directive to capture subexpressions of the
matched value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98659 13f79535-47bb-0310-9956-ffa450edef68
2003-02-14 20:04:39 +00:00
André Malo
e61a3b67b8 style issues. no code changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98628 13f79535-47bb-0310-9956-ffa450edef68
2003-02-12 17:58:09 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Brian Pane
8790e33ba6 Fix for BrowserMatchNoCase, which was incorrectly treating non-regex
patterns as case-sensitive
Submitted by:	Andr�� Malo
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97705 13f79535-47bb-0310-9956-ffa450edef68
2002-11-30 21:48:12 +00:00
Ken Coar
7d79ef3ded Add a SERVER_ADDR keyword to match the CGI environment variable,
to allow conditional setting according to the IP address on
	which the server received the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97494 13f79535-47bb-0310-9956-ffa450edef68
2002-11-12 18:30:00 +00:00
Bill Stoddard
952d5d2db0 Detabbify
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97394 13f79535-47bb-0310-9956-ffa450edef68
2002-11-04 18:17:50 +00:00
Brian Pane
14f29c98a7 Fixed a segfault
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95030 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 13:51:10 +00:00
Jeff Trawick
20dd15e4d1 fix a build failure with some non-gcc compilers...
an example message: "The ":" operator is not allowed between
"const char*" and "int"."


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95029 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 10:56:43 +00:00
Brian Pane
0738d0e80a Performance fix: When a BrowserMatch or SetEnvIf pattern doesn't
actually require regular expression parsing, use a fast string search
instead.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95027 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 07:51:16 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Doug MacEachern
a2965c7c77 two performance improvements:
- switch from using r->notes to r->request_config
- avoid a strcmp() when checking if val eq '!'

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92120 13f79535-47bb-0310-9956-ffa450edef68
2001-11-22 01:43:33 +00:00
Ian Holsman
eea38d7c2e This patch changes the apr_table_elts macro so that it provides
access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.


Submitted by:	Brian Pane <BPane@pacbell.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91860 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 22:31:04 +00:00
Bill Stoddard
e36b1ebae6 Extend mod_setenvif to support specifying regular expressions
on the SetEnvIf (and SetEnvIfNoCase) directive attribute field.
Example:  SetEnvIf ^TS*  [a-z].* HAVE_TS
will cause HAVE_TS to be set if any of the request headers begins
with "TS" and has a value that begins with any character in the
set [a-z]. [Bill Stoddard]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89353 13f79535-47bb-0310-9956-ffa450edef68
2001-06-12 17:06:04 +00:00
Bill Stoddard
0a9d23aa8f Enable SetEnvIf to handle taking a regex on the header name (SPECIAL_NOT case).
For example:

SetEnvIf ^TS* ^[a-z].*  HAVE_TS

will cause HAVE_TS to be set if a header beginning with TS appears in the request
and the value of that header starts with [a-z]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89325 13f79535-47bb-0310-9956-ffa450edef68
2001-06-09 15:57:06 +00:00
William A. Rowe Jr
0c36e11416 icase is intialized as the result of an (a == b) expression, it makes
no sense as an unsigned, and this eliminates all compiler emits from
  the module


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88795 13f79535-47bb-0310-9956-ffa450edef68
2001-04-10 20:35:18 +00:00