Repository: trafficserver Updated Branches: refs/heads/master fc81a028a -> 42271ef64
[TS-2314] - addressing code review comments from James Peach and Alan M Carroll Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c39484ab Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c39484ab Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c39484ab Branch: refs/heads/master Commit: c39484ab051f2d7b03216e65ce557773d594dce0 Parents: 2ee3bcf Author: Sudheer Vinukonda <[email protected]> Authored: Thu Sep 25 16:19:15 2014 +0000 Committer: Sudheer Vinukonda <[email protected]> Committed: Thu Sep 25 16:19:15 2014 +0000 ---------------------------------------------------------------------- doc/reference/configuration/records.config.en.rst | 6 +++--- proxy/http/HttpSM.cc | 7 ++++--- proxy/http/HttpTransact.cc | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c39484ab/doc/reference/configuration/records.config.en.rst ---------------------------------------------------------------------- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index defcefe..7776e6e 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -1091,9 +1091,9 @@ Cache Control here is to avoid multiple origin connections for the same cacheable object upon a cache miss. The possible values of this config are: - - ``0`` = never allow - - ``1`` = always allowed - - ``2`` = allowed, only if the ``Range`` requested can be satisfied from cache + - ``0`` = never read while writing + - ``1`` = always read while writing + - ``2`` = always read while writing, but allow non-cached Range requests through to the origin The ``2`` option is useful to avoid delaying requests which can not easily be satisfied by the partially written response. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c39484ab/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 46402f2..5b3f5f1 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -65,6 +65,8 @@ #define USE_NEW_EMPTY_MIOBUFFER +extern int cache_config_read_while_writer; + // We have a debugging list that can use to find stuck // state machines DLL<HttpSM> debug_sm_list; @@ -4227,7 +4229,7 @@ HttpSM::parse_range_and_compare(MIMEField *field, int64_t content_length) HTTPInfo::FragOffset* frag_offset_tbl = t_state.cache_info.object_read->get_frag_table(); int frag_offset_cnt = t_state.cache_info.object_read->get_frag_offset_count(); - if (!frag_offset_tbl || (frag_offset_tbl[frag_offset_cnt - 1] < (uint64_t)end)) { + if (!frag_offset_tbl || !frag_offset_cnt || (frag_offset_tbl[frag_offset_cnt - 1] < (uint64_t)end)) { Debug("http_range", "request range in cache, end %" PRId64 ", frg_offset_cnt %d, frag_size %" PRId64, end, frag_offset_cnt, frag_offset_tbl[frag_offset_cnt - 1]); t_state.range_in_cache = false; } @@ -4326,8 +4328,7 @@ HttpSM::do_range_setup_if_necessary() } // if only one range entry and pread is capable, no need transform range - if (t_state.num_range_fields == 1 && - (cache_sm.cache_read_vc->is_pread_capable() || t_state.range_in_cache)) { + if (t_state.num_range_fields == 1 && cache_sm.cache_read_vc->is_pread_capable()) { t_state.range_setup = HttpTransact::RANGE_NOT_TRANSFORM_REQUESTED; } else if (api_hooks.get(TS_HTTP_RESPONSE_TRANSFORM_HOOK) == NULL) { Debug("http_trans", "Unable to accelerate range request, fallback to transform"); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c39484ab/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index ef0ffd5..c5e8b2f 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -67,7 +67,6 @@ static char range_type[] = "multipart/byteranges; boundary=RANGE_SEPARATOR"; extern HttpBodyFactory *body_factory; extern int cache_config_vary_on_user_agent; -extern int cache_config_read_while_writer; static const char local_host_ip_str[] = "127.0.0.1";
