Repository: trafficserver Updated Branches: refs/heads/master 726b68c69 -> dda3209af
TS-2632 Fixes to check the new configs properly Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dda3209a Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dda3209a Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dda3209a Branch: refs/heads/master Commit: dda3209afae73ecd3e5cd9d53d11f2dba528cac6 Parents: 726b68c Author: Leif Hedstrom <[email protected]> Authored: Mon Jun 9 14:47:24 2014 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Mon Jun 9 14:47:28 2014 -0600 ---------------------------------------------------------------------- proxy/http/HttpSM.cc | 2 ++ proxy/http/HttpTransact.cc | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda3209a/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 1d455cd..2302e5d 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -4037,6 +4037,8 @@ HttpSM::parse_range_and_compare(MIMEField *field, int64_t content_length) if (content_length <= 0) return; + + // ToDo: Can this really happen? if (content_length == INT64_MAX) { t_state.range_setup = HttpTransact::RANGE_NOT_HANDLED; return; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda3209a/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 08f4146..9ba5186 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -1848,7 +1848,9 @@ HttpTransact::OSDNSLookup(State* s) StartAccessControl(s); // If skip_dns is enabled and no ip based rules in cache.config and parent.config // Access Control is called after DNS response } else { - if ((s->cache_info.action == CACHE_DO_NO_ACTION) && s->hdr_info.client_request.presence(MIME_PRESENCE_RANGE)) { + if ((s->cache_info.action == CACHE_DO_NO_ACTION) && + (((s->hdr_info.client_request.presence(MIME_PRESENCE_RANGE) && !s->txn_conf->cache_range_write) || + s->range_setup == RANGE_NOT_SATISFIABLE || s->range_setup == RANGE_NOT_HANDLED))) { TRANSACT_RETURN(SM_ACTION_API_OS_DNS, HandleCacheOpenReadMiss); } else if (s->cache_lookup_result == HttpTransact::CACHE_LOOKUP_SKIPPED) { TRANSACT_RETURN(SM_ACTION_API_OS_DNS, LookupSkipOpenServer); @@ -3085,7 +3087,8 @@ HttpTransact::HandleCacheOpenReadMiss(State* s) // We must, however, not cache the responses to these requests. if (does_method_require_cache_copy_deletion(s->method) && s->api_req_cacheable == false) { s->cache_info.action = CACHE_DO_NO_ACTION; - } else if (s->hdr_info.client_request.presence(MIME_PRESENCE_RANGE)) { + } else if ((s->hdr_info.client_request.presence(MIME_PRESENCE_RANGE) && !s->txn_conf->cache_range_write) || + s->range_setup == RANGE_NOT_SATISFIABLE || s->range_setup == RANGE_NOT_HANDLED) { s->cache_info.action = CACHE_DO_NO_ACTION; } else { s->cache_info.action = CACHE_PREPARE_TO_WRITE;
