1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00
Commit Graph

1764 Commits

Author SHA1 Message Date
William A. Rowe Jr
33cfa9b34c Not that hard to explain...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670805 13f79535-47bb-0310-9956-ffa450edef68
2015-04-02 01:50:45 +00:00
Graham Leggett
09c4bc62d0 http: Add support for RFC2324/RFC7168.
Sample implementation: http://people.apache.org/~minfrin/mod_teapot.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670594 13f79535-47bb-0310-9956-ffa450edef68
2015-04-01 10:03:56 +00:00
Yann Ylavic
03a97d3da0 core: Follow up to r1664071: comments on new keep_alive_timeout_set flag.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664299 13f79535-47bb-0310-9956-ffa450edef68
2015-03-05 10:41:19 +00:00
Yann Ylavic
df173b940d core: If explicitly configured, use the KeepaliveTimeout value of the
virtual host which handled the latest request on the connection, or by
default the one of the first virtual host bound to the same IP:port.

For non-async MPMs, use either r->server's or c->base_server's value in
ap_process_http_sync_connection() depending on a new server_rec's flag
called keep_alive_timeout_set and determined at config time.

For event MPM, use a queue per timeout value, chaining the queues per
type (keepalive wrt KeepAliveTimeout, write completion wrt to Timeout)
so that maintenance can be done on all the queues from the head, and such
that insertions/maintenance remain in O(1).
A server config is created and pointing to the queue of each vhost at
post_config time, hence the config can be associated to the connection
state (cs) at post_read_request time (keep_alive_timeout_set is used to
determine r->server vs c->base_server here), and we can simply insert
with TO_QUEUE_INSERT(cs->sc->q, cs).  PR56226.

While at it, since each queue now embeds it own timeout and hence the
expiration_time of the cs has changed to a queue_timestamp (the time it
was queued), we can detect clock skews and expire entries immediatly if
the system is set (eg. far) in the past during runtime and we want to
avoid waiting for (eg.) centuries before the current logic kills them.
Any entry which is registered above now + q->timeout is concerned, and
is now cleaned from the queue when encountered.  PR57374.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664071 13f79535-47bb-0310-9956-ffa450edef68
2015-03-04 16:58:01 +00:00
Eric Covener
05a733e484 PR54613: protect the invoke_mtx with #if APR_HAS_THREADS.
No MMN bump, httpd.h cannot be compiled today without APR_HAS_THREADS. With
APR_HAS_THREADS there is no structure layout change.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1663375 13f79535-47bb-0310-9956-ffa450edef68
2015-03-02 17:47:43 +00:00
Jeff Trawick
4bc31da012 Follow-up to r1661487:
Change the real MMN


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661489 13f79535-47bb-0310-9956-ffa450edef68
2015-02-22 16:10:02 +00:00
Jeff Trawick
6830babddd Provide separate SSL_CT_*_STATUS variables for client vs. proxy
connections, courtesy of a new flag passed from mod_ssl on its
pre_connection "optional hook."


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661487 13f79535-47bb-0310-9956-ffa450edef68
2015-02-22 15:50:54 +00:00
Graham Leggett
9850539bd7 core: Add expression support to ErrorDocument. Switch from a fixed
sized 664 byte array per merge to a hash table.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661448 13f79535-47bb-0310-9956-ffa450edef68
2015-02-21 23:59:05 +00:00
Eric Covener
d5227d2da4 expand comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656062 13f79535-47bb-0310-9956-ffa450edef68
2015-01-30 17:15:02 +00:00
Eric Covener
2154a9de68 Provide a way for EXEC_ON_READ directives to see their context
(parent directive).

Usually, this context is not also EXEC_ON_READ so it's not fully processed, so
e.g cmd->path is not fluffed up yet because the closing tag
of the section is not read yet and ap_check_cmd_context()
doesn't work)




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656058 13f79535-47bb-0310-9956-ffa450edef68
2015-01-30 16:58:20 +00:00
Eric Covener
a77068dd87 AP_INIT_NO_ARGS mishandled in macro
Submitted by: Joachim Zobel <jzobel heute-morgen.de>, covener
Committed by: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1655146 13f79535-47bb-0310-9956-ffa450edef68
2015-01-27 20:21:48 +00:00
William A. Rowe Jr
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
William A. Rowe Jr
0271656a56 Revert r4635428 corresponding to PR41867.
The code reverted attempted to restrict comparisons of the r->filename
to given DirectoryMatch blocks.

r->filename was already a non-directory entity at this point, because we
have already fallen out of the } while (thisinfo.filetype == APR_DIR);
block above.

The addition of r->d_is_directory was redundant.  That is what is always
returned by ap_get_core_module_config(r->per_dir_config).

Note modifying dir_config required an MMN major bump as this commit could
have realigned the offset of refs (had it been added to the end, this
would correspond to an mmn minor bump) and other fields packed into the
same bytes (this is undefined). Bump on revert to prevent unexpected crashes.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653666 13f79535-47bb-0310-9956-ffa450edef68
2015-01-21 21:39:55 +00:00
Rainer Jung
7cb5913e8a Happy New Year 2015
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1648840 13f79535-47bb-0310-9956-ffa450edef68
2015-01-01 13:05:30 +00:00
Eric Covener
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
Jeff Trawick
9a0f8c31ad minor commentary and indentation fixes for ap_log_*data()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643538 13f79535-47bb-0310-9956-ffa450edef68
2014-12-06 15:04:27 +00:00
Jeff Trawick
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
Jan Kaluža
bd41584fcb * ap_exr: Add replace(string, from, to) function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642154 13f79535-47bb-0310-9956-ffa450edef68
2014-11-27 13:46:11 +00:00
Yann Ylavic
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
Jan Kaluža
7dd5dc8bf6 core: Do not match files when using DirectoryMatch. PR41867.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635428 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 08:34:12 +00:00
Yann Ylavic
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
Rainer Jung
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
Rainer Jung
1aa6158bda Forgotten file needed for r1612934.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612940 13f79535-47bb-0310-9956-ffa450edef68
2014-07-23 20:27:32 +00:00
Christophe Jaillet
8e20c7682e Fix comment.
Remove @file and @brief from within the @defgroup to be consistenbt with doxygen comments from other files.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611919 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 16:37:29 +00:00
Christophe Jaillet
f791c1b710 Move comment from .c to .h in order to make use of it in doxygen.
Fix the comment that states that these vars are NULL on ASCII machine, they seem to be undefined instead.
Rework some comments.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611916 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 13:36:52 +00:00
Christophe Jaillet
bd1bd0e448 Improve doxygen comment.
Generate the doc even if build on non-EBCDIC system + fix a comment about non-EBCDIC system. In this case, these vars are undefined, not NULL.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611908 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 13:03:36 +00:00
Christophe Jaillet
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
Christophe Jaillet
9c7dcf3420 Improve doxygen comment.
Improve layout, fix typo, generate relevant doc even if build on non-EBCDIC system + add note that these functions are mostly noop on non-EBCDIC system.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611858 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 08:35:51 +00:00
Christophe Jaillet
49c60b3581 Fix typo spotted by Mike Rumph
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611481 13f79535-47bb-0310-9956-ffa450edef68
2014-07-17 21:36:02 +00:00
Christophe Jaillet
d9bf1fb718 Improve doxygen comment.
Improve layout, add trailing '.' in function description, capitalize first letter of description, fix typo, turn \0 into \\0.
Move the detailed description after @defgroup so that it is taken into account.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611252 13f79535-47bb-0310-9956-ffa450edef68
2014-07-17 05:34:12 +00:00
Christophe Jaillet
78b2f62d17 Improve doxygen comment.
Improve layout, add trailing '.' in function description, remove unneeded @fn.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611210 13f79535-47bb-0310-9956-ffa450edef68
2014-07-16 22:22:49 +00:00
Christophe Jaillet
4832755832 Improve doxygen comment.
Improve layout, add trailing '.' in function description, remove unneeded @fn.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611202 13f79535-47bb-0310-9956-ffa450edef68
2014-07-16 22:09:39 +00:00
Eric Covener
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
Joe Orton
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
Joe Orton
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
Jan Kaluža
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
Eric Covener
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
Takashi Sato
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
Yann Ylavic
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
Takashi Sato
2d240e9c71 Follow up r1601943:
Fix typo. No functional change.

Pointed out by mrumph


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602058 13f79535-47bb-0310-9956-ffa450edef68
2014-06-12 03:32:50 +00:00
Jeff Trawick
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
Takashi Sato
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
Yann Ylavic
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
Christophe Jaillet
178d3027ef Fix URL in doxygen comment.
Previous link was broken.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599799 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 21:11:31 +00:00
Jim Jagielski
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
Jim Jagielski
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
Jim Jagielski
c539206da2 Optimize w/ duplicated listeners and use of SO_REUSEPORT
where available.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599531 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 13:07:29 +00:00
Christophe Jaillet
147c51bdba Doxygen fix + alignment + typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1598207 13f79535-47bb-0310-9956-ffa450edef68
2014-05-29 06:20:36 +00:00
Christophe Jaillet
ae73522711 Doxygen fix + reorg to match how other header files are built
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597639 13f79535-47bb-0310-9956-ffa450edef68
2014-05-26 20:09:09 +00:00
Eric Covener
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