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
Stefan Fritsch
ca2948ea2d
update log tags
...
replace duplicate, add missing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481396 13f79535-47bb-0310-9956-ffa450edef68
2013-05-11 19:45:09 +00:00
Graham Leggett
a6d1be91ef
mod_cache: If a 304 response indicates an entity not currently cached, then
...
the cache MUST disregard the response and repeat the request without the
conditional.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481197 13f79535-47bb-0310-9956-ffa450edef68
2013-05-10 21:40:54 +00:00
Graham Leggett
5c93801e65
Ensure that Warning headers are correctly handled as per RFC2616.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1480283 13f79535-47bb-0310-9956-ffa450edef68
2013-05-08 14:06:48 +00:00
Graham Leggett
e225273e6a
mod_cache: Ensure that we don't attempt to replace a cached response
...
with an older response as per RFC2616 13.12.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479966 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 16:16:16 +00:00
Graham Leggett
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
Graham Leggett
e362111d24
mod_cache: Ensure that updated responses to HEAD requests don't get
...
mistakenly paired with a previously cached body. Ensure that any existing
body is removed when a HEAD request is cached.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479411 13f79535-47bb-0310-9956-ffa450edef68
2013-05-05 22:27:31 +00:00
Graham Leggett
0eb8aa4a48
mod_cache: Honour Cache-Control: no-store in a request.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479222 13f79535-47bb-0310-9956-ffa450edef68
2013-05-05 01:12:48 +00:00
Graham Leggett
4d2b3c1a7d
mod_cache: RFC2616 14.9.3 The s-maxage directive also implies the
...
semantics of the proxy-revalidate directive.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479216 13f79535-47bb-0310-9956-ffa450edef68
2013-05-04 23:03:13 +00:00
Graham Leggett
d1612031a9
mod_cache: Make sure that contradictory entity headers present in a 304
...
Not Modified response are caught and cause the entity to be removed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479117 13f79535-47bb-0310-9956-ffa450edef68
2013-05-04 14:55:03 +00:00
Guenter Knauf
99a323a122
Silent no-prototype compiler warning.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478798 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 14:05:01 +00:00
Graham Leggett
0ef0994152
mod_cache: Make sure Vary processing handles multivalued Vary headers and
...
multivalued headers referred to via Vary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478748 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 12:19:26 +00:00
Graham Leggett
f18afbfba1
mod_cache: When serving from cache, only the last header of a multivalued
...
header was taken into account. Fixed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478441 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 16:51:27 +00:00
Graham Leggett
9f68cf2010
mod_cache: Ignore response headers specified by no-cache=header and
...
private=header as specified by RFC2616 14.9.1 What is Cacheable. Ensure
that these headers are still processed when multiple Cache-Control
headers are present in the response. PR 54706
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478382 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 14:24:26 +00:00