1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-08 04:22:21 +03:00
Commit Graph

299 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
ab7b448082 Fix segfault caused by r1204104 on non-async mpms.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204180 13f79535-47bb-0310-9956-ffa450edef68
2011-11-20 16:41:42 +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
Jim Jagielski
59066a3ff3 Change def timeout from a nasty 5 mins to a more reasonable 1min
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199485 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 22:07:58 +00:00
Graham Leggett
b84938b043 mod_include: Add support for application/x-www-form-urlencoded encoding
and decoding.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1194870 13f79535-47bb-0310-9956-ffa450edef68
2011-10-29 11:13:37 +00:00
Stefan Fritsch
308d06fd8d Improve handling of maxlen = APR_SIZE_MAX, noticed by Jim.
Use apr_pregsub_ex() and maxlen = 0 for unlimited in mod_substitute.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1189985 13f79535-47bb-0310-9956-ffa450edef68
2011-10-27 20:15:36 +00:00
Stefan Fritsch
04ca93ecff Limit ap_pregsub() to 64K, add ap_pregsub_ex() for longer strings and with
better error reporting. Modify ap_varbuf_regsub() to be similar to
ap_pregsub_ex().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1188950 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 22:29:13 +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
103f776c25 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@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
Stefan Fritsch
01ed21af9d Add wrappers for malloc, calloc, realloc that check for out of memory
situations.  Use them in most places where malloc, and friends are used.
This results in clean error messages in an out of memory situation instead of
segfaulting or silently malfunctioning. In some places, it just allows to
remove some logging code.

PR 51568, PR 51569, PR 51571.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 16:25:42 +00:00
Stefan Fritsch
817a209e9a Fix cut'n'paste errors: APR_DECLARE -> AP_DECLARE
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171652 13f79535-47bb-0310-9956-ffa450edef68
2011-09-16 16:37:06 +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
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
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
Stefan Fritsch
18fdb9d711 Some improvements for handling of many connections for MPM event:
- Process lingering close asynchronously instead of tying up worker threads
  (based on patch by Jeff Trawick).

- If the number of connections of a process is above

     threads_per_child  +  WORKER_OVERCOMMIT * (idle_workers - 1)

  (WORKER_OVERCOMMIT is fixed at 2, at the moment), or if all workers are busy,
  don't accept new connections in that process. Such a dynamic connection limit
  is necessary because we may have both async and non-async (ssl) connections.
  WORKER_OVERCOMMIT should be a config option.

- Don't count idle workers of not-accepting processes against MinSpareThreads,
  so that the parent will spawn new processes when necessary.

- If we receive a keep-alive request while all workers are busy, don't block
  but close the connection immediately so that the client will re-connect to a
  different process.

Related changes:

- Log what is going on at trace loglevels.
- Remove the bypass_push poll type flag, this code cannot be hit anymore
  (if it ever could?).
- Add some macro helpers for dealing with timeout queues.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137358 13f79535-47bb-0310-9956-ffa450edef68
2011-06-19 12:23:42 +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
Jeff Trawick
1dd9594f5e spelling fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096624 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 22:49:59 +00:00
Jeff Trawick
bc956c30c3 fix doxygen warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086071 13f79535-47bb-0310-9956-ffa450edef68
2011-03-27 23:36:03 +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
81386f1120 spelling fix in a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1076859 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 22:43:53 +00:00
Guenter Knauf
abcb9e3011 Axed C++ comments and tabs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1074809 13f79535-47bb-0310-9956-ffa450edef68
2011-02-26 09:34:47 +00:00
Jim Jagielski
ec88a92d83 Expose "new" ap_parse_form_data() function instead of requiring
mod_request for any module that may want to parse form data...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1072099 13f79535-47bb-0310-9956-ffa450edef68
2011-02-18 18:40:31 +00:00
Stefan Fritsch
7665ada739 Raise DYNAMIC_MODULE_LIMIT to 256
discussed at
http://mail-archives.apache.org/mod_mbox/httpd-dev/201006.mbox/%3C4C268563.30006@rowe-clan.net%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1066864 13f79535-47bb-0310-9956-ffa450edef68
2011-02-03 16:51:28 +00:00
Stefan Fritsch
6e108fd44f Make ap_pstr2_alnum accept const char dest
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1061695 13f79535-47bb-0310-9956-ffa450edef68
2011-01-21 09:03:52 +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
Jim Jagielski
334ae2f5a2 Make it clear that '_' is a possible char and accepted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060802 13f79535-47bb-0310-9956-ffa450edef68
2011-01-19 13:08:08 +00:00
Jim Jagielski
a713db09d4 Make the balancer shared memory slot more human readable. But we need
to make it a "safe" filename, so create 2 funcs which do that.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060657 13f79535-47bb-0310-9956-ffa450edef68
2011-01-19 02:41:49 +00:00
Stefan Fritsch
f73cbb7949 Clarify usage of ap_pregcomp/ap_pregfree
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026642 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 16:38:03 +00:00
Stefan Fritsch
70be0f7a07 Add ErrorLogFormat directive for configuring the error log format, including
additional information that is logged once per connection or request.

Add error log IDs for connections and request to allow correlating error log
lines and the corresponding access log entry.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992806 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:44:19 +00:00
Jim Jagielski
b6c87a8750 Pull out "does request have a body" logic to a central
canon function and use that for the 100-Continue OK
check.

Should likely also start using this in the various
other places we do this "have body" check thruout
the codebase...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986699 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 14:30:50 +00:00
Paul Querna
ad53d4dcbd CVE-2010-1452: Fix handling of missing path segments in the parsed URI structure.
If a specially crafted request was sent, it is possible to crash mod_dav, 
mod_cache or mod_session, as they accessed a field that is set to NULL
by the URI parser, assuming that it always put in a valid string.

PR: 49246
Submitted by: Mark Drayton
Patch by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966348 13f79535-47bb-0310-9956-ffa450edef68
2010-07-21 18:25:01 +00:00
Stefan Fritsch
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
Stefan Fritsch
cd6924b086 To save memory, make module_levels a vector of chars instead of ints.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959392 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 18:09:06 +00:00
Stefan Fritsch
6b2857259b Add deferred write pool to core_output_filter to clean up file descriptors as
soon as the corresponding response has been sent and not only after the
connection has been closed.

This change does not deal with pipelined requests, yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956202 13f79535-47bb-0310-9956-ffa450edef68
2010-06-19 09:10:54 +00:00
Stefan Fritsch
2334a1ea4f - Add loglevels to request_rec and conn_rec
- Introduce per-directory loglevel configuration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951897 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:04:40 +00:00
Stefan Fritsch
98a1e93dca - Introduce log levels trace1/.../trace8
- Add macro wrappers for ap_log_*error. On C99, this will save argument
  preparation and function call overhead when a message is not logged
  because of the configured loglevel.
- Introduce per-module loglevel configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951893 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:54:51 +00:00
Stefan Fritsch
f0f10037c8 Add docstring for ap_pregsub()
PR: 48265
Submitted by: Peter Poeml


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906242 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03 21:06:52 +00:00
Daniel Earl Poirier
04fd4abf90 Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.
I added a few more fixes, and there are still more that might
need a doxygen expert.

PR: 48061
Submitted by: Brad Hards
Reviewed by: poirier


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830527 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28 13:25:49 +00:00
Joe Orton
900d08e517 * include/httpd.h: Fix comment implying that LimitRequestLine
and LimitRequestFieldsize cannot raise limits -- no longer the
  case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819480 13f79535-47bb-0310-9956-ffa450edef68
2009-09-28 08:56:36 +00:00
Jim Jagielski
83532ab628 Enhance ap_hook_monitor to pass along a server_rec (in
general the ap_server_conf) and tuck away some storage
in there which may be useful as an opaque data pointer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@818825 13f79535-47bb-0310-9956-ffa450edef68
2009-09-25 11:59:30 +00:00
Ruediger Pluem
7f346368c7 * Lower memory usage by reusing the brigade instead of constantly
recerating one.

Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814807 13f79535-47bb-0310-9956-ffa450edef68
2009-09-14 19:46:36 +00:00
Brian Havard
60fbe11de1 Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@807930 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 08:56:13 +00:00
Jeff Trawick
596fa29157 the only "retuned" in the entire server was, alas, not meant to be
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761749 13f79535-47bb-0310-9956-ffa450edef68
2009-04-03 18:22:12 +00:00
Jeff Trawick
ee32468a33 remove OS/2 platform support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758929 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:47:52 +00:00
Jeff Trawick
2f9b9fdd70 remove BeOS OS support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758891 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 22:23:44 +00:00
Paul Querna
69f2fd40dc Add conn_rec::current_thread.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@742218 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 00:57:58 +00:00
Roy T. Fielding
421ee8b008 Disabled DefaultType directive and removed ap_default_type()
from core.  We now exclude Content-Type from responses for which
a media type has not been configured via mime.types, AddType,
ForceType, or some other mechanism.  MMN major bump to NZ time.

PR: 13986



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@739382 13f79535-47bb-0310-9956-ffa450edef68
2009-01-30 19:12:51 +00:00
Nick Kew
15ad1d5eb2 Add support for escaping all non-ascii chars to ap_escape_html, and use
it to fix PR#25202: encoding="entity" doesn't work as advertised in
mod_include.
For backport, this'll need an ABI-preserving version that'll be
a minor MMN bump.  But if we do that in /trunk/, it'll never change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@730296 13f79535-47bb-0310-9956-ffa450edef68
2008-12-31 02:27:24 +00:00
Paul Querna
03eb917952 New API, ap_body_to_table, a very ineffeicent and bad hack to remove an apreq dependency.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/wombat-integration@723652 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 08:36:26 +00:00