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

599 Commits

Author SHA1 Message Date
Rainer Jung
0c12000aed Add output for "?auto" version of server-status
to proxy status, mod_ssl session cache info,
mod_cache_socache and the status hook of the
individual socache implementations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1671397 13f79535-47bb-0310-9956-ffa450edef68
2015-04-05 13:54:22 +00:00
Yann Ylavic
0a431ef862 core, modules: like r1657897 but for core and other modules than mod_proxy.
More uses of ap_map_http_request_error() and AP_FILTER_ERROR so that we never
return an HTTP error status from a handler if some filter generated a response
already.

That is, from a handler, either ap_get_brigade() (an input filter) returned
AP_FILTER_ERROR and we must forward it to ap_die(), or ap_pass_brigade() (an
output filter) failed with any status and we must return AP_FILTER_ERROR in
any case for ap_die() to determine whether a response is needed or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665625 13f79535-47bb-0310-9956-ffa450edef68
2015-03-10 17:25:17 +00:00
Jan Kaluža
53e095830b * mod_cache: Preserve the Content-Type in case of 304 response.
304 does not contain Content-Type and mod_mime regenerates
the Content-Type based on the r->filename. This later leads to original
Content-Type to be lost (overwriten by whatever mod_mime generates).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665216 13f79535-47bb-0310-9956-ffa450edef68
2015-03-09 12:48:11 +00:00
Joe Orton
750aa727b0 * modules/cache/mod_socache_memcache.c (socache_mc_store): Pass
through expiration time.

Submitted by: Faidon Liambotis <paravoid debian.org>, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1649491 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 10:06:29 +00:00
Gregg Lewis Smith
7ffd981a56 Added include path for Windows build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1644245 13f79535-47bb-0310-9956-ffa450edef68
2014-12-09 23:55:22 +00:00
Guenter Knauf
27f17af2a7 Added include path for NetWare build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642099 13f79535-47bb-0310-9956-ffa450edef68
2014-11-27 11:30:54 +00:00
Eric Covener
94c4cc461f fix another case of 304 response sent to an unconditional request
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1634237 13f79535-47bb-0310-9956-ffa450edef68
2014-10-25 17:45:30 +00:00
Yann Ylavic
edf45934d4 mod_cache: avoid unlikely access to freed memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1632740 13f79535-47bb-0310-9956-ffa450edef68
2014-10-18 08:46:42 +00:00
Rainer Jung
49fd895b9e Silence build warning about missing prototype.
Followup to r1629507.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629652 13f79535-47bb-0310-9956-ffa450edef68
2014-10-06 13:39:30 +00:00
Rainer Jung
41c01c3fd4 mod_cache_socache: Change average object size
hint from 32 bytes to 2048 bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629508 13f79535-47bb-0310-9956-ffa450edef68
2014-10-05 17:05:21 +00:00
Rainer Jung
5cbd89b1da mod_cache_socache: Add cache status to server-status.
The status_hook simply calls the status function of
socache, very much like mod_ssl does for the ssl
session cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629507 13f79535-47bb-0310-9956-ffa450edef68
2014-10-05 17:00:31 +00:00
Eric Covener
f1c62e52e5 use actual error code in AH00779
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626416 13f79535-47bb-0310-9956-ffa450edef68
2014-09-20 10:59:30 +00:00
Jan Kaluža
2fa69ec094 SECURITY (CVE-2014-3581): Fix a mod_cache NULL pointer deference
in Content-Type handling.

mod_cache: Avoid a crash when Content-Type has an empty value. PR56924.

Submitted By: Mark Montague <mark catseye.org>
Reviewed By: Jan Kaluza


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624234 13f79535-47bb-0310-9956-ffa450edef68
2014-09-11 09:18:38 +00:00
Rainer Jung
7dd1f3d0c3 Fix typo in comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620461 13f79535-47bb-0310-9956-ffa450edef68
2014-08-25 21:32:43 +00:00
Eric Covener
31fffa60f9 don't let handlers start with r->status = 304 during a failed revalidation
PR56881



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619835 13f79535-47bb-0310-9956-ffa450edef68
2014-08-22 15:26:27 +00:00
Christophe Jaillet
3a25c513f3 Add missing APLOGNO.
Refactor to keep APLOGNO on the same line as ap_log_error, when applicable.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611978 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 22:02:53 +00:00
Jan Kaluža
66dc61a3f4 mod_cache: try to use the key of a possible open but stale cache entry
if we have one in cache_try_lock(). PR 50317

Submitted by: Ruediger Pluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597533 13f79535-47bb-0310-9956-ffa450edef68
2014-05-26 09:15:44 +00:00
Rainer Jung
acd15709aa mod_socache_shmcb: Correct counting of expirations for status display.
Expirations happening during retrieval were not counted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595426 13f79535-47bb-0310-9956-ffa450edef68
2014-05-17 06:01:35 +00:00
Yann Ylavic
be383e6c93 mod_cache: follow up to r1594643.
Avoid table lookup if not necessary (fast path first).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594648 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 17:34:05 +00:00
Yann Ylavic
baf4f92af0 mod_cache: follow up to r1591328.
Define the cache_merge_headers_out() function to merge r->err_headers_out into
r->headers_out and add the ones from r->content_type/encoding if available.
Use it in ap_cache_cacheable_headers_out() where the same is done and in
cache_save_filter() where this has to be done before updating the entry.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594643 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 17:11:49 +00:00
Yann Ylavic
308f0615fd mod_cache: follow up to r1591390
Fix code typo.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591394 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 16:53:00 +00:00
Yann Ylavic
f33d682667 mod_cache: follow up to r1591322
Avoid one unnecessary test when checking 304 contradictions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591390 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 16:34:15 +00:00
Yann Ylavic
4d2d2c5edc mod_cache: Preserve non-cacheable headers forwarded from an origin 304
response. PR 55547.

When mod_cache asks for a revalidation of a stale entry and the origin responds
with a 304 (not that stale), the module strips the non-cacheable headers from
the origin response and merges the stale headers to update the cache.

The problem is that mod_cache won't forward the non-cacheable headers to the
client, for example if the 304 response contains both Set-Cookie and
'Cache-Control: no-cache="Set-Cookie"' headers, or CacheIgnoreHeaders is used.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591328 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:58:33 +00:00
Yann Ylavic
0e28401e45 mod_cache: follow up to r1591320.
Use the new MOD_CACHE_ENTITY_HEADERS[] names to check 304 contradictions
against the same headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591322 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:53:35 +00:00
Yann Ylavic
75e24df9a8 mod_cache: Don't add cached/revalidated entity headers to a 304 response.
PR 55547.

When the conditional request meets the conditions of the stale then revalidated
entry, the forwarded 304 response includes the entity headers merged from the
cached headers (before updating the entry).
Strip them before returning a 304.

Since the entity headers are stripped elsewhere, factorize the code using a
new table (MOD_CACHE_ENTITY_HEADERS[]) containing these headers's names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591320 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:43:27 +00:00
Yann Ylavic
241c1c3d0e Revert r1591312 (again) to commit the 2 fixes separately.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591316 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:33:21 +00:00
Yann Ylavic
676b474db1 mod_cache: Don't add cached/revalidated entity headers to a 304 response.
PR 55547.

When the conditional request meets the conditions of the stale then revalidated
entry, the forwarded 304 response includes the entity headers merged from the
cached headers (before updating the entry).
Strip them before returning a 304.

Since the entity headers are stripped elsewhere, factorize the code using a
new table (MOD_CACHE_ENTITY_HEADERS[]) containing these headers's names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591312 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:25:45 +00:00
Yann Ylavic
e14c0e4755 mod_cache: Retry unconditional request with the full URL (including the
query-string) when the origin server's 304 response does not
           match the conditions used to revalidate the stale entry.

http://www.mail-archive.com/dev@httpd.apache.org/msg59884.html


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591143 13f79535-47bb-0310-9956-ffa450edef68
2014-04-29 23:28:11 +00:00
Eric Covener
e31a8d28cb Fix errors with CacheLock on Windows:
cache_util.c(757): (OS 80)The file exists.  : [client 127.0.0.1:63889] 
AH00784: Attempt to obtain a cache lock for stale cached URL failed, 
revalidating entry anyway: 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588704 13f79535-47bb-0310-9956-ffa450edef68
2014-04-19 20:21:01 +00:00
Christophe Jaillet
ebcf0f34d2 Fix layout
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586827 13f79535-47bb-0310-9956-ffa450edef68
2014-04-12 07:57:44 +00:00
Eric Covener
43fbd8b76b leave a warning about cc_out
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584429 13f79535-47bb-0310-9956-ffa450edef68
2014-04-03 22:19:23 +00:00
Christophe Jaillet
1b6e2b3ebf s/apr_pstrndup/apr_pstrmemdup/ when applicable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563381 13f79535-47bb-0310-9956-ffa450edef68
2014-02-01 08:26:33 +00:00
Eric Covener
b826c7cadd add the URI to DEBUG message 00765 (and drop an exclamation point):
Cache provider's store_body failed!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563193 13f79535-47bb-0310-9956-ffa450edef68
2014-01-31 17:40:54 +00:00
Christophe Jaillet
a0164c6ce7 Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1549680 13f79535-47bb-0310-9956-ffa450edef68
2013-12-09 21:11:09 +00:00
Eric Covener
d40eaa2b65 Only close hdrs.fd when returning non-OK from cache_select(),
because it will be read from in the very next mod_cache callback
recall_headers().  Problem masked on unix by buffering.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1547845 13f79535-47bb-0310-9956-ffa450edef68
2013-12-04 17:09:42 +00:00
Jeff Trawick
11a39fba77 don't pass uninitialized rv passed to ap_log_rerror()
(rv wasn't interesting / follow an existing example)

stop throwing away a pointer on the heap

(clang scan-build)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534892 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 01:32:32 +00:00
Graham Leggett
e62246ac2b SECURITY (CVE-2013-4352): Fix a NULL pointer deference which allowed
untrusted origin servers to crash mod_cache in a forward proxy configuration.

mod_cache: Avoid a crash with strcmp() when the hostname is not provided.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1523235 13f79535-47bb-0310-9956-ffa450edef68
2013-09-14 13:32:25 +00:00
Eric Covener
397bdd8c43 Expires in a 304 is not a contradiction in terms of r1487118:
- Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1518269 13f79535-47bb-0310-9956-ffa450edef68
2013-08-28 16:07:50 +00:00
Stefan Fritsch
e7bb7d063a Limit SHMCB_MAX_SIZE to min(UINT_MAX, APR_SIZE_MAX) to match the current code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1515162 13f79535-47bb-0310-9956-ffa450edef68
2013-08-18 16:30:21 +00:00
Eric Covener
39ebf1bf09 reflow a very long line, no functional change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1502665 13f79535-47bb-0310-9956-ffa450edef68
2013-07-12 19:33:19 +00:00
Eric Covener
80475f6ca2 fix whitespace in AH00766 warning:
s/all of theinput/all of the input/



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1501423 13f79535-47bb-0310-9956-ffa450edef68
2013-07-09 18:21:43 +00:00
Guenter Knauf
3b905a6fb4 Fix some compiler warnings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1500362 13f79535-47bb-0310-9956-ffa450edef68
2013-07-07 03:12:52 +00:00
Eric Covener
7df09b69d4 recognize the "defualt handler name" in r->handler, which is used when
no SetHandler/AddHandler and no matching mimetype during type_checker.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496711 13f79535-47bb-0310-9956-ffa450edef68
2013-06-26 02:32:39 +00:00
Rainer Jung
472f2a43ba Fix "variable 'rv' may be used uninitialized
in this function" warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1494536 13f79535-47bb-0310-9956-ffa450edef68
2013-06-19 10:21:46 +00:00
Graham Leggett
8bad51f56a Correct the use of the printf formatter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1493925 13f79535-47bb-0310-9956-ffa450edef68
2013-06-17 20:34:26 +00:00
Graham Leggett
96d4951170 mod_socache_shmcb.c: Remove arbitrary restriction on shared memory size
previously limited to 64MB.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1493921 13f79535-47bb-0310-9956-ffa450edef68
2013-06-17 20:22:10 +00:00
Graham Leggett
1dbe136a17 mod_cache_socache: Make sure the CacheSocacheMaxSize directive is merged
correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1492663 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 13:16:18 +00:00
Jeff Trawick
7e7f76f56c const goodness with nasty strrchr and strchr functions
(resolve warning in maintainer mode)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491564 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 18:43:45 +00:00
Graham Leggett
c0d199e03a mod_cache_socache: Use the name of the socache implementation when performing
a lookup rather than using the raw arguments.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491458 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 14:08:43 +00:00
Guenter Knauf
c6971bfe19 Fixed signed<->unsigned compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1490550 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 09:04:32 +00:00