1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-11 02:42:23 +03:00
Commit Graph

261 Commits

Author SHA1 Message Date
Stefan Fritsch
8ee1c0a5d7 Replace strdup by ap_malloc to ensure a proper error message if out-of-memory.
While there, only allocate memory for the string part we actually use.

PR: 54345


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1425771 13f79535-47bb-0310-9956-ffa450edef68
2012-12-25 20:43:15 +00:00
Fabien Coelho
0886d3fcaf Add minor 'Warning' directive as defined in current mod_macro.
* server/core.c: add 'Warning' directive by extending the 'Error'
  directive implementation. The 'Error' behavior is slightly changed
  so as to use verbose ap_log_error instead of returning the message.
* docs/manual/mod/core.xml: add documentation for 'Warning'.
* server/config.c: add comment about syntax vs configuration errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1418677 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 14:49:09 +00:00
Eric Covener
03c3591330 PR54223: 2.4 generates AH00554 when Include points to a directory with no wildcard.
r931435 refactored ap_process_resource_config() so it didn't read through 
directories, but also changed a path non-fnmatch directories are passed 
through to call ap_process_resource_config().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1415023 13f79535-47bb-0310-9956-ffa450edef68
2012-11-29 01:34:19 +00:00
Jeff Trawick
df3f06b4e8 "Iterate" directives: Report an error if no arguments are provided.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1397172 13f79535-47bb-0310-9956-ffa450edef68
2012-10-11 17:11:31 +00:00
Jeff Trawick
dfc4862f0e add pre_htaccess hook; in conjunction with earlier dirwalk_stat
and post_perdir_config hooks, this should allow mpm-itk to be
used without patches to httpd core



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1389339 13f79535-47bb-0310-9956-ffa450edef68
2012-09-24 12:42:32 +00:00
Eric Covener
3b55add953 style in the neighborhood of a bug
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1359881 13f79535-47bb-0310-9956-ffa450edef68
2012-07-10 20:10:27 +00:00
Jim Jagielski
fc1b444d2e Fold on Jeff's DefaultRuntimeDir impl... docs on the way
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1297955 13f79535-47bb-0310-9956-ffa450edef68
2012-03-07 12:31:58 +00:00
Nick Kew
e0ddfe0fdf Core configuration: add AllowOverride option to treat syntax
errors in .htaccess as non-fatal.
PR 52439



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1229021 13f79535-47bb-0310-9956-ffa450edef68
2012-01-09 04:01:06 +00:00
William A. Rowe Jr
2aa21a62b1 Clean up size_t abuse, part 2. ap_malloc/calloc/realloc are explicitly
excluded from this cleanup as they must be signature identical to the
clib functions, and although the definition of size_t has been flakey,
the definition of those functions appears to be generally clean since
ANSI C.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1228323 13f79535-47bb-0310-9956-ffa450edef68
2012-01-06 18:15:08 +00:00
Stefan Fritsch
91ce790cd3 Limit length of lines in .htaccess to 8K again, to reduce DoS potential.
Make ap_varbuf_cfg_getline() strictly enforce the max_len parameter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1213338 13f79535-47bb-0310-9956-ffa450edef68
2011-12-12 17:50:33 +00:00
Stefan Fritsch
26d5fb7164 Add some more log message tags
Remove some log message tags from ap_log_* calls that log lots of
different error messages, in particular the config parsing errors.
Not sure how we should handle those.

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG
to TRACE1-3



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1210252 13f79535-47bb-0310-9956-ffa450edef68
2011-12-04 22:09:24 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +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
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
84a104bb22 Add ap_varbuf API for resizable buffers.
Increase length limit of lines in the configuration file to 16MB.
Increase length limit of lines in the group file to 16MB.

PR: 45888, 50824, 43084

Windows and Netware build changes are untested.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157354 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 09:06:35 +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
Stefan Fritsch
77bd4820bc use temp pool for temp string
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153653 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 20:35:03 +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
527d18b6ca Use APR_UNSPEC to allow startup on IP6-only systems.
PR: 50592
Submitted by: Joe Orton, 2510 <root linkage white-void net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1146256 13f79535-47bb-0310-9956-ffa450edef68
2011-07-13 19:21:11 +00:00
Stefan Fritsch
4bc8885d8d Fix "statement not reached" warnings with sun cc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1139391 13f79535-47bb-0310-9956-ffa450edef68
2011-06-24 17:59:44 +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
Jeff Trawick
7eb4cae399 disable hook probes for our two hooks which have no args
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101671 13f79535-47bb-0310-9956-ffa450edef68
2011-05-10 22:52:45 +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
e77a332640 Prevent segfault if DYNAMIC_MODULE_LIMIT is reached
PR: 51072
Submitted by: Torsten Förtsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1092787 13f79535-47bb-0310-9956-ffa450edef68
2011-04-15 19:04:29 +00:00
Stefan Fritsch
7b61bedb2f Change the ap_cfg_getline() and ap_cfg_getc() to return an error code.
Also:
- Make ap_cfg_getline() return APR_ENOSPC if a config line is too long.
- Add ap_pcfg_strerror() function to convert ap_cfg_getline's return value
  into a nice message.
- Adjust definition of ap_configfile_t accordingly.

Not bumping MMN because it has already been bumped today.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086756 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 21:29:34 +00:00
Eric Covener
c329a283e3 typo in format string for 1070660
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070663 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 20:51:42 +00:00
Eric Covener
071085f420 Log a hint about the directory needing to be executable
when we hit EACCESS searching for htaccess files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070660 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 20:49:56 +00:00
Stefan Fritsch
74d4b6625d Optimize memory access pattern of ap_merge_per_dir_configs()
According to Linux perf, this is twice as fast as the old loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1066869 13f79535-47bb-0310-9956-ffa450edef68
2011-02-03 17:02:38 +00:00
Nick Kew
eb8657d216 config: report error and exit cleanly if getaddrinfo fails at startup
PR: 50592


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059472 13f79535-47bb-0310-9956-ffa450edef68
2011-01-16 04:22:25 +00:00
Stefan Fritsch
39db8e5413 mod_proxy: Fix ProxyPassInterpolateEnv directive.
PR: 50292


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1036602 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18 20:15:24 +00:00
Ruediger Pluem
38064564e9 * Fix parameter name as new is a reserved word in C++ which makes compiling
of http_config.h with C++ impossible.

PR: 50243


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1033427 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10 12:09:27 +00:00
Stefan Fritsch
286c8622b6 Add a generic pool cleanup function that sets a pointer to NULL and use
it to replace various pool cleanup functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032167 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 22:12:41 +00:00
Stefan Fritsch
00cdb469d7 use temp pool in some more places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026657 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 18:06:49 +00:00
Stefan Fritsch
1a54421be0 Set the LogLevel of a newly initialized virtual hosts to UNSET. Otherwise
it will not be correctly merged in ap_fixup_virtual_hosts().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024427 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 21:53:38 +00:00
Stefan Fritsch
5507079237 merge if blocks
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003816 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 15:32:51 +00:00
Stefan Fritsch
10e73f91c7 Use ptemp in some places to save some memory when parsing included config
files


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003809 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 15:04:08 +00:00
Stefan Fritsch
049ba34b53 core: Speed up config parsing if using a very large number of config
files

PR: 50002
Submitted by: andrew cloudaccess net


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003808 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 14:44:20 +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
Stefan Fritsch
8f840cb763 core: Abort with sensible error message if no or more than one MPM is
loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987806 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 18:06:41 +00:00
Jeff Trawick
105ce3617b follow up r987629 with another similar issue
curr_parent can't be NULL (or we segfault elsewhere), so 
don't check for NULL


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987631 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 20:47:35 +00:00
Jeff Trawick
43ca6cc239 remove useless check for current == NULL; if it is NULL, a
segfault will occur right before the function returns anyway
(IOW, caller must not pass in NULL for that arg)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 20:39:02 +00:00
Stefan Fritsch
ae5ef058ac Add ap_find_module_short_name() to quickly get the module short name
(i.e. symbol name with trailing "_module" removed) from the module_index.
To be used for logging.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965408 13f79535-47bb-0310-9956-ffa450edef68
2010-07-19 10:06:15 +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
Jeff Trawick
f9828853b0 spelling fix for a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959031 13f79535-47bb-0310-9956-ffa450edef68
2010-06-29 17:00:23 +00:00
Stefan Fritsch
37ab7c96a6 Save some memory by allocating only the required length for conf_vectors.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@958285 13f79535-47bb-0310-9956-ffa450edef68
2010-06-26 21:28:36 +00:00
Joe Orton
7189b776db Run filter "init" functions exactly once per request. No longer run
init functions for connection filters (doing an "init" once per
handler invocation makes no sense for a connection filter).  No longer 
run init functions multiple times per request if a subrequest is used.

* include/util_filter.h (ap_filter_rec_t): Clarify use of the init
  function pointer.

* server/config.c (invoke_filter_init): Drop ap_ prefix for private
  function; take a request_rec pointer and only invoke filters with
  matching request.
  (ap_invoke_handler): Adjust accordingly.

PR: 49328
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953311 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 12:52:49 +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
William A. Rowe Jr
1108773c08 First order simplification; Add IncludeOptional for introducing
wildcard pattern matches or specific includes which may be omitted.
Refactors ap_process_resource_config() to deal efficiently with 
a single file, and renames the new _ex() flavor per list discussion
to  ap_process_fnmatch_configs() for wildcard processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@931435 13f79535-47bb-0310-9956-ffa450edef68
2010-04-07 04:51:46 +00:00