1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

462 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
Stefan Fritsch
40ac38ff05 Remove MPM-private stuff from conn_state_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204104 13f79535-47bb-0310-9956-ffa450edef68
2011-11-19 23:35:46 +00:00
Greg Ames
f380e0c8ab ap_core_translate: factor out duplicate code. no functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1202236 13f79535-47bb-0310-9956-ffa450edef68
2011-11-15 15:20:38 +00:00
Jeff Trawick
5405226ae2 end-generation hook: Fix false notification of end-of-generation for
temporary intervals with no active MPM children.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200449 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 17:46:57 +00:00
Jeff Trawick
239e4c0466 config generation # (reported by ap_state_query(AP_SQ_CONFIG_GEN):
* start at 0 instead of 1
* don't increment until after pconf cleanups run, in case a 
  cleanup needs to check the related config generation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200147 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:52:52 +00:00
Stefan Fritsch
44cd57149b fix typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199528 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 23:27:52 +00:00
Stefan Fritsch
b791885bad Only init the RNG once at startup. This saves some entropy and works around the APR bug
fixed in r1198921


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198930 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 20:57:02 +00:00
Stefan Fritsch
7c5a4c2bc9 Call apr_random_after_fork() manually in the child processes because the MPMs
use plain fork() and not apr_proc_fork().
Also add some workaround for APR not changing the RNG state in the parent.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198868 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 18:46:47 +00:00
Stefan Fritsch
0ddfb3e6cc Add -D DUMP_RUN_CFG option to dump some configuration items
from the parsed (or default) config. This is useful for init scripts that
need to setup temporary directories and permissions, for example if those
temporary directories are located on a ram disk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180681 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 18:35:23 +00:00
Stefan Fritsch
a216c436c6 Downgrade error log messages which accompany a 404 request status from loglevel
error to info.

List thread at
http://mail-archives.apache.org/mod_mbox/httpd-dev/201110.mbox/%3Calpine.DEB.2.00.1110041948280.664@eru.sfritsch.de%3E

PR: 35768


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180328 13f79535-47bb-0310-9956-ffa450edef68
2011-10-08 07:36:56 +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
Guenter Knauf
026b641a70 Fix cut'n'paste errors: APR_DECLARE -> AP_DECLARE / part2.
Submitted by: NormW <normw gknw.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171850 13f79535-47bb-0310-9956-ffa450edef68
2011-09-16 23:20:01 +00:00
Stefan Fritsch
2d4e23d88b Create wrapper API for apr_random;
use in mod_lbmethod_heartbeat and mod_serf to
- replace some needles use of apr_generate_random_bytes
- remove code duplication


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171247 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 19:53:59 +00:00
Jim Jagielski
625b89a7e2 Add in MaxRangeOverlaps and MaxRangeReversals to accomodate
more control over acceptable Range headers:

        See: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/311

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1169756 13f79535-47bb-0310-9956-ffa450edef68
2011-09-12 14:15:53 +00:00
Eric Covener
c45e14b246 refactor to pull setting of Accept-Ranges header into http_protocol.c which
had been copied to other handlers.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166663 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08 12:56:08 +00:00
Eric Covener
fe5f7b561d take care of some MaxRanges feedback:
* allow "none" to be expressed in config
 * send Accept-Ranges: none with MaxRanges none
 * stop accepting confusing/ambiguous "0", start accepting "unlimited".



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166282 13f79535-47bb-0310-9956-ffa450edef68
2011-09-07 17:29:49 +00:00
Eric Covener
1aaea94cb5 add MaxRanges directive institute a default limit of 200 (post-merge where
applicable) Ranges before returning the complete resource.

(minor mmn bump for core_dir_config addition)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162584 13f79535-47bb-0310-9956-ffa450edef68
2011-08-28 20:35:07 +00:00
Stefan Fritsch
9bd21d2c8a Forbid some directives in .htaccess because of AllowOverrideList:
core:          AllowOverride, AllowOverrideList
mod_authn_dbd: AuthDBDUserPWQuery, AuthDBDUserRealmQuery
mod_authz_dbd: AuthzDBDQuery, AuthzDBDRedirectQuery
mod_proxy:     BalancerMember, ProxySet

Adjust for use in .htaccess:
mod_actions:   Script


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153687 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 22:10:27 +00:00
Stefan Fritsch
9d2ca013b6 cleanups related to new AllowOverrideList functionality:
- add new NOT_IN_HTACCESS flag for ap_check_cmd_context() 
- describe the need for this in new_api_2_4.xml
- forbid Define and UnDefine in .htaccess


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153676 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 21:36:18 +00:00
Stefan Fritsch
c1f50be04f Adjust some messages for <If> blocks and remove some dead code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153674 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 21:28:42 +00:00
Daniel Ruggeri
0d69087127 Add AllowOverrideList directive and documentation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151654 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 22:24:14 +00:00
Stefan Fritsch
0aad1ca971 Use ap_document_root() in ap_core_translate() to allow modules like
mod_vhost_ldap let core do the name translation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151361 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 07:23:35 +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
fba947527f Introduce new function ap_get_conn_socket() to access the socket of
a connection


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135153 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 16:02:18 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +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
93623482e3 - Add <ElseIf> and <Else> to complement <If> sections. These are both easier
to use and more efficient than using several <If> sections.
- Update <If> documentation a bit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132469 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 18:15:02 +00:00
Stefan Fritsch
ae7fa449a9 Use define'd names for constants
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1131463 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 18:43:35 +00:00
Jim Jagielski
2aef21903c Cleanup... most don't need apr_hooks.h at all...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101067 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 15:36:32 +00:00
Jeff Trawick
462c69e0b5 Add child_status hook for tracking creation/termination of MPM child
processes.  Add end_generation hook for notification when the last
MPM child of a generation exits.

end_generation is implemented completely by core using the
child_status hook run by the MPM.

simple and mpmt_os2 MPMs don't currently run the child_status
hook, so neither hook is invoked with those MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 21:21:22 +00:00
Stefan Fritsch
bf07c1867c Add new ap_reserve_module_slots/ap_reserve_module_slots_directive API,
necessary if a module (like mod_perl) registers additional modules later than the
EXEC_ON_READ phase.

Tested by: Torsten Foertsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096569 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 19:22:04 +00:00
Stefan Fritsch
b510d83098 The pre_config hook should return int, not apr_status_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1095213 13f79535-47bb-0310-9956-ffa450edef68
2011-04-19 21:01:52 +00:00
Stefan Fritsch
621c77a0fd core: Support module names with colons in loglevel configuration.
Submitted by: Torsten Förtsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090369 13f79535-47bb-0310-9956-ffa450edef68
2011-04-08 17:59:48 +00:00
Jim Jagielski
6bd438fe64 Add in a configuration generation... this is independent of
MPM gen, just in case we ever switch MPMs at a graceful ;)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087331 13f79535-47bb-0310-9956-ffa450edef68
2011-03-31 15:12:09 +00:00
Jeff Trawick
efb9ddbde7 match docs for case of "ScoreBoardFile"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086297 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 16:50:11 +00:00
Jeff Trawick
5e3ba7d3ee mpm_common.c implements a handful of config directives; the
related state has to be re-initialized to the default values
at pre-config time, but that was handled inconsistently by
the MPMs, resulting in unexpected behavior when some of the
directives were removed across restart

move that necessary initialization from the MPMs to common 
code run from core's pre-config; MPMs that need to override
defaults can do so by running after core's pre-config (the 
NetWare MPM now does that)

the DEFAULT_MAX_REQUESTS_PER_CHILD compile setting wasn't useful
enough to keep

the simple MPM wasn't consistent in which of these directives
were respected and which weren't, and that hasn't changed
(see procmgr.max_requests_per_child vs. ap_max_requests_per_child)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086293 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 16:25:20 +00:00
Daniel Earl Poirier
fdaaf209c5 core: AllowEncodedSlashes new option NoDecode to allow encoded slashes
in request URL path info but not decode them. Change behavior of option
"On" to decode the encoded slashes as 2.0 and 2.2 do.  PR 35256,
PR 46830.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082196 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:45:25 +00:00
Jeff Trawick
4598f1a7d4 fix some grammar mistakes, mostly in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 00:35:39 +00:00
Stefan Fritsch
d6de9e9f67 Create new ap_state_query() function that allows modules to determine
if the current configuration run is the initial one at server startup,
and if the server is started for testing/config dumping only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070151 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 21:18:32 +00:00
Ruediger Pluem
de9cd44921 * Only unset if we have a table. This can happen if undefine occurs before define.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1061669 13f79535-47bb-0310-9956-ffa450edef68
2011-01-21 08:01:09 +00:00
Stefan Fritsch
77ce7da768 Add support to set variables with the 'Define' directive. Change
ap_resolve_env() to look for variables defined in this way. This allows to use
the variables in the config using the ${VAR} syntax known from envvar
interpolation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1061465 13f79535-47bb-0310-9956-ffa450edef68
2011-01-20 19:12:32 +00:00
Stefan Fritsch
58f17628ac Move ap_resolve_env to core.c, in preparation for adding mod_define-like
variable support.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1061444 13f79535-47bb-0310-9956-ffa450edef68
2011-01-20 18:37:47 +00:00
Stefan Fritsch
209d890731 Initialize the core_dir_config->sec_files and ->sec_if only if needed.
This saves some memory and two apr_array_append()s per directory merge.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060283 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18 09:58:26 +00:00
Stefan Fritsch
df4e1648fd remove some redundant NULL assignments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060255 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18 09:12:00 +00:00
Stefan Fritsch
a38d3c9e23 Merge the <If> sections in a separate step ap_if_walk, after ap_location_walk.
This makes <If> apply to all requests, not only to file base requests and
it allows to use <If> inside <Directory>, <Location>, and <Files> sections.

The merging of <If> sections always happens after the merging of <Location>
sections, even if the <If> section is embedded inside a <Directory> or
<Files> section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059867 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 11:02:38 +00:00
Stefan Fritsch
cd52e0e73a eliminate another var named 'c' which is not a conn_rec
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053954 13f79535-47bb-0310-9956-ffa450edef68
2010-12-30 17:46:06 +00:00
Igor Galić
47fde5a7e8 Applying patch from PR 33078 (with slight changes to its return values)
This patch disallows the mixing of relative (+/-) and absolute Options where insensible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053375 13f79535-47bb-0310-9956-ffa450edef68
2010-12-28 15:56:46 +00:00
Igor Galić
21e0a16abb Changing the default Options from All to FollowSymlinks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1052419 13f79535-47bb-0310-9956-ffa450edef68
2010-12-24 00:37:30 +00:00
Eric Covener
676cc45e8b PR50349: Honor 'AcceptPathInfo OFF' during internal redirects,
such as per-directory mod_rewrite substitutions.   This would be left floating 
around in the request_rec with a pcalloc'ed value, so the core fixup
hook thought some module had overridden it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1043023 13f79535-47bb-0310-9956-ffa450edef68
2010-12-07 13:06:22 +00:00
Eric Covener
81ba030297 simplify ServerName check with apr_fnmatch_test()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042157 13f79535-47bb-0310-9956-ffa450edef68
2010-12-04 12:03:38 +00:00