590 Commits

Author SHA1 Message Date
09a7ffc55d Bump mmn as documented in commit log msg r1653666
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653667 13f79535-47bb-0310-9956-ffa450edef68
2015-01-21 21:42:36 +00:00
85d1a0ba01 Allow SetHandler+UDS+fcgi to take advantage of dedicated workers including
opting in to connection reuse and other proxy options (max=, etc).

adds 'enablereuse' proxyoption and a minor MMN bump to share
proxy_desocketfy outside of mod_proxy.c, which is required to
match workers to URLs.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647009 13f79535-47bb-0310-9956-ffa450edef68
2014-12-20 15:56:16 +00:00
d49e6f0ad9 core: Add CGIPassAuth directive to control whether HTTP authorization
headers are passed to scripts as CGI variables.

PR: 56855


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642847 13f79535-47bb-0310-9956-ffa450edef68
2014-12-02 12:20:21 +00:00
61d5a3c1ca MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531
less intrusive.

Submitted by: Yingqi Lu <yingqi.lu@intel.com>
Modified/Committed by: ylavic

Add ListenCoresBucketsRatio which is a configurable ratio between the number of
CPU cores (online) and the number of listeners buckets to create, defaulting to
zero (so that listeners buckets become an opt-in, ie. ncpus / ratio > 1).
This could also be made an opt-out by using the previous hardcoded value (8) as
default.

Make ap_close_listeners() act on all the listeners (including duplicated ones),
since the function is also called externally (eg. mod_cgid, mod_ssl_ct and
possibly any third party module) to cleanup opened descriptors when a process
is forked (the duplicated listeners are kept in a scoped/static variable).

Add ap_close_listeners_ex() to close a single bucket of listeners, used by the
children to close unused duplicates and internally by ap_close_listeners().

Make ap_duplicate_listeners() compute the number of buckets to be used, instead
of each MPM. This number is now based on the above ratio and will not change
unless asked to (given *num_buckets < 1, that is when the MPM does not run in
one-process mode nor after a graceful restart).

Remove some global variables (mpm_listen, enable_default_listeners) previously
used to communicate between MPMs and ap_listen, since ap_duplicate_listeners()
API can now be used to do so.
Also rename num_buckets as ap_num_listen_buckets, and prefix have_so_reuseport
with ap_ (both printed by ap_log_common(), hence kept global).
Detect ap_have_so_reuseport once only at startup.

Restore dummy_connection() as before r1599531 since sending POD signals should
not depend on the number of listeners buckets (there is still one single socket
receiving the connections).

For each MPM (concerned), move the bucket data (pod, listeners and eventually
accept mutex) into a struct and instanciate an array of them (sized by the
number of buckets), for each child to use its own data according to its bucket
index, and the parent to maintain the whole.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635521 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 15:24:58 +00:00
a527db4331 core: Use process scoreboard to store each child's listener bucket,
and silently adjust the configured number of processes/threads to
be above the computed number of listener buckets (depending on the
CPU cores).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629909 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 15:16:02 +00:00
20dc474d1a Minor mmn bump due to r1612940.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1613189 13f79535-47bb-0310-9956-ffa450edef68
2014-07-24 17:02:03 +00:00
15415bf247 Improve doxygen comment.
Use a comment already present as the doxygen  description of the module.
Remove a useless @def.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611880 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 10:30:42 +00:00
8cc5e00f9e *) SECURITY: CVE-2013-5704 (cve.mitre.org)
core: HTTP trailers could be used to replace HTTP headers
     late during request processing, potentially undoing or
     otherwise confusing modules that examined or modified
     request headers earlier.  Adds "MergeTrailers" directive to restore
     legacy behavior.  

Submitted By: Edward Lu, Yann Ylavic, Joe Orton, Eric Covener
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610814 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 19:11:02 +00:00
bb2749fd6e SECURITY (CVE-2014-0117): Fix a crash in mod_proxy. In a reverse
proxy configuration, a remote attacker could send a carefully crafted
request which could crash a server process, resulting in denial of
service.

Thanks to Marek Kroemeke working with HP's Zero Day Initiative for
reporting this issue.

* server/util.c (ap_parse_token_list_strict): New function.

* modules/proxy/proxy_util.c (find_conn_headers): Use it here.

* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
  Send a 400 for a malformed Connection header.

Submitted by: Edward Lu, breser, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610674 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 12:27:00 +00:00
b2605d20c4 SECURITY (CVE-2014-0226): Fix a race condition in scoreboard handling,
which could lead to a heap buffer overflow.  Thanks to Marek Kroemeke
working with HP's Zero Day Initiative for reporting this.

* include/scoreboard.h: Add ap_copy_scoreboard_worker.

* server/scoreboard.c (ap_copy_scoreboard_worker): New function.

* modules/generators/mod_status.c (status_handler): Use it.

* modules/lua/lua_request.c (lua_ap_scoreboard_worker): Likewise.

Reviewed by: trawick, jorton, covener, jim
Submitted by: jorton, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610491 13f79535-47bb-0310-9956-ffa450edef68
2014-07-14 19:26:00 +00:00
c37d4591a6 bump mmn because of r1609680
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609709 13f79535-47bb-0310-9956-ffa450edef68
2014-07-11 12:49:54 +00:00
2eaa646655 make LDAPConnectionPoolTTL more conservative, use r->request_time rather than
end-of-request time, and only update it after a round-trip with the LDAP
server rather than every time we check back into the pool.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1607960 13f79535-47bb-0310-9956-ffa450edef68
2014-07-05 00:06:15 +00:00
3d83bde5ef Revert r1601943, r1602058, r1605307 (socket callback returning pollfds)
Revert r1605369 (wstunnel refactoring)

per discassion on dev@httpd.a.o thread Message-ID:
<CALK=YjN9HfThP_k_rF9iJPcUhcQk9sNOaDPxZNG+HcJNWS4ZAQ@mail.gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1605946 13f79535-47bb-0310-9956-ffa450edef68
2014-06-27 04:17:30 +00:00
ec95d72c5a mod_proxy: Don't limit the size of the connectable Unix Domain Socket paths.
Since connect() to UDS path is used at several places, introduce
ap_proxy_connect_uds() in proxy_util.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602989 13f79535-47bb-0310-9956-ffa450edef68
2014-06-16 20:26:24 +00:00
66b5e4834b fix AP_IS_DEAULT_HANDLER_NAME
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601995 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 19:30:01 +00:00
0e4cf76a64 Socket event callback now takes pollfd.
User (e.g. mod_proxy_wstunnel) can know
which socket is ready.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601943 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 16:39:34 +00:00
ff0963e3f7 mpm_event[opt]: Send the SSL close notify alert when the KeepAliveTimeout
expires. PR54998.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601185 13f79535-47bb-0310-9956-ffa450edef68
2014-06-07 22:57:08 +00:00
db0457b3b2 Break out common code to be share-able
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599641 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 16:02:44 +00:00
55701bdc09 We really need some place where we can place a whole
bunch of data/info-that-should-be-logged-by-all-mpms.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599601 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 15:22:37 +00:00
fba67798ed PR56333: Add an API to resume a connection that a handler has previously suspended.
Submitted by: Artem <artemciy gmail.com>, Edward Lu <Chaosed0 gmail.com>
Committed by: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593860 13f79535-47bb-0310-9956-ffa450edef68
2014-05-11 20:52:32 +00:00
d758951456 Extend the socket callbacks in event to allow a timeout on the I/O callback.
When a socket callback has a timeout, an associated timer event is used to 
remove the sockets from the pollset and call a timeout function.

* This includes a noteworthy change to the main event loop. Previously,
we would call epoll, then process the timer events, then iterate through the
poll results. After this patch, the timer events are processed before the poll()
a _non-queued_ action can change the pollset conents (a users timed callback
function conversely could easily sit in a queue while the main thread continues
down into epoll)

* timer events can now have sockets associated with them, those sockets are 
removed from the pollset when the timer event fires w/o a queue to the worker.

* timer events now have a canceled flag that can be toggled without locking
the timer list. 

* Drop the severity of some wstunnel messages from DEBUG to TRACE1

* Lift the restriction on using asynchronous websockets connections but having
an idle timeout



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593857 13f79535-47bb-0310-9956-ffa450edef68
2014-05-11 20:41:45 +00:00
f82af68aa4 mod_ssl: Add hooks to allow other modules to perform processing at
several stages of initialization and connection handling.  See
mod_ssl_openssl.h.

This is enough to allow implementation of Certificate Transparency
outside of mod_ssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587607 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 15:25:03 +00:00
5512fa1b86 mod_proxy_http: Add detach_backend hook.
The immediate use is for a SSL-related module which works
on the backend proxy connection to be able to "leak" information
into the client r for logging.

This could be useful with other proxy scheme handlers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586719 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 17:07:18 +00:00
6a9b7697e5 Follows up r1572606.
MMN minor bump required by proxy_conn_rec change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572611 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:06:23 +00:00
b122567955 Add in the concept of "slave" connections...
Allows for several "connections" all resulting in
a single real connection that talks to the network.
Right now, nothing uses this though.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1565657 13f79535-47bb-0310-9956-ffa450edef68
2014-02-07 13:54:38 +00:00
99ca42198f followups to r1557641 suggested by nd -- add
prefix to both the macro and the handler name 
itself.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1559394 13f79535-47bb-0310-9956-ffa450edef68
2014-01-18 19:14:14 +00:00
6d582e83aa don't search for directory indexes/directoryslashes if a URL is in the
middle of being rewritten [in per-dir context]. PR53929


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1557641 13f79535-47bb-0310-9956-ffa450edef68
2014-01-13 01:51:58 +00:00
93143eb07b Add directives to control two protocol options:
HttpContentLengthHeadZero - allow Content-Length of 0 to be returned on HEAD
 HttpExpectStrict - allow admin to control whether we must see "100-continue"

This is helpful when using Ceph's radosgw and httpd.

Inspired by: Yehuda Sadeh <yehuda@inktank.com>
See https://github.com/ceph/apache2/commits/precise

* include/http_core.h
  (core_server_config): Add http_cl_head_zero and http_expect_strict fields.
* modules/http/http_filters.c
  (ap_http_header_filter): Only clear out the C-L if http_cl_head_zero is not
  explictly set.
* server/core.c
  (merge_core_server_configs): Add new fields.
  (set_cl_head_zero, set_expect_strict): New config helpers.
  (HttpContentLengthHeadZero, HttpExpectStrict): Declare new directives.
* server/protocol.c
  (ap_read_request): Allow http_expect_strict to control if we return 417.
* include/ap_mmn.h
  (MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR): Bump.
* CHANGES: Add a brief description.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554303 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 20:01:14 +00:00
43e022f007 core: Support named groups and backreferences within the LocationMatch,
DirectoryMatch, FilesMatch and ProxyMatch directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554300 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 19:50:52 +00:00
540be85c46 Add suspend_connection and resume_connection hooks to notify modules
when the thread/connection relationship changes.  (Currently implemented
only for the Event MPM; should be implemented for all async MPMs.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546759 13f79535-47bb-0310-9956-ffa450edef68
2013-11-30 17:56:25 +00:00
aab3f8ad29 Fix error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1545415 13f79535-47bb-0310-9956-ffa450edef68
2013-11-25 21:41:29 +00:00
452c223fe6 Add parse_errorlog_arg callback to ap_errorlog_provider to allow providers
to check the ErrorLog argument. Implement this check in mod_syslog.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1541029 13f79535-47bb-0310-9956-ffa450edef68
2013-11-12 12:14:50 +00:00
d79b9a03c5 mod_proxy: Add ap_connection_reusable() for checking if a connection
is reusable as of this point in processing.

mod_proxy_fcgi uses the new API to determine if FCGI_CONN_CLOSE
should be enabled, but that doesn't change existing behavior
since the connection is currently marked for closure elsewhere
in the module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526189 13f79535-47bb-0310-9956-ffa450edef68
2013-09-25 14:29:02 +00:00
904b3f8d8b Add AP_ERRORLOG_PROVIDER_ADD_EOL_STR flag for ap_errorlog_provider, bump MMN.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525845 13f79535-47bb-0310-9956-ffa450edef68
2013-09-24 11:03:55 +00:00
1b52eab8b8 Update related to r1519556
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519587 13f79535-47bb-0310-9956-ffa450edef68
2013-09-03 07:26:34 +00:00
8f3558bf2d Add util_fcgi.h and associated definitions and support
routines for FastCGI, based largely on mod_proxy_fcgi.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1513454 13f79535-47bb-0310-9956-ffa450edef68
2013-08-13 12:16:39 +00:00
0d02cd5c6d Add ap_log_data(), ap_log_rdata(), etc. for logging buffers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1512819 13f79535-47bb-0310-9956-ffa450edef68
2013-08-10 19:50:58 +00:00
7fbc93eac7 Restore support for the AUTH_HANDLED return code in AUTHN providers,
like in 2.2, which allows authn provider to return their own status
in r->status (custom error code, or return a redirect)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1499351 13f79535-47bb-0310-9956-ffa450edef68
2013-07-03 12:13:50 +00:00
a011e2a43f Replace pre_htaccess hook with more flexible open_htaccess hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1498880 13f79535-47bb-0310-9956-ffa450edef68
2013-07-02 11:26:41 +00:00
cd331723ca factor out DEFAULT_HANDLER_NAME
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496709 13f79535-47bb-0310-9956-ffa450edef68
2013-06-26 02:29:43 +00:00
286e82c27d *) core: merge AllowEncodedSlashes from the base configuration into
(non-default) name-based virtual hosts. [Eric Covener]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496339 13f79535-47bb-0310-9956-ffa450edef68
2013-06-25 02:48:25 +00:00
ce60943aec Added missing bump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491701 13f79535-47bb-0310-9956-ffa450edef68
2013-06-11 07:50:11 +00:00
9bc9d79079 core: Stop the HTTP_IN filter from attempting to write error buckets
to the output filters, which is bogus in the proxy case. Create a
clean mapping from APR codes to HTTP status codes, and use it where
needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482522 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:58:06 +00:00
d2e6782ea7 mod_proxy, mod_proxy_http: Connection headers must be stripped on the way
in and out, support an optional function to handle this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482075 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:11:36 +00:00
6194962c46 core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
with weak validation combined with If-Range and Range headers. Break
out explicit conditional header checks to be useable elsewhere in the
server. Ensure weak validation RFC compliance in the byteranges filter.
Ensure RFC validation compliance when serving cached entities. PR 16142


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 13:42:31 +00:00
997e0f6d33 core: Add the ability to do explicit matching on weak and strong ETags
as per RFC2616 Section 13.3.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479528 13f79535-47bb-0310-9956-ffa450edef68
2013-05-06 11:41:10 +00:00
5cdd5b8e23 * Minor bump as documented (missed in r1478140)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479058 13f79535-47bb-0310-9956-ffa450edef68
2013-05-04 08:49:12 +00:00
6e77e5b20f mod_cache: Invalidate cached entities in response to RFC2616 Section
13.10 Invalidation After Updates or Deletions. PR 15868

Resolves outstanding issue with r1070179 as per
http://www.gossamer-threads.com/lists/apache/dev/395830?do=post_view_threaded#395830


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478140 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 18:49:04 +00:00
a47569f7c1 core, mod_ssl: Lift the restriction that prevents mod_ssl taking
full advantage of the event MPM. Enable the ability for a module
to reverse the sense of a poll event from a read to a write or vice
versa.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470679 13f79535-47bb-0310-9956-ffa450edef68
2013-04-22 19:48:25 +00:00
4149fb80f4 mod_dav: Improve error handling in dav_method_put(), add new
dav_join_error() function.

PR: 54145

Submitted by: Ben Reser <ben reser.org>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1464241 13f79535-47bb-0310-9956-ffa450edef68
2013-04-04 00:22:52 +00:00