Repository: trafficserver Updated Branches: refs/heads/master 2aec6d7c7 -> 470309e35
TS-3912 Fixes the code such that clang-analyzer is happy, and no goto Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/470309e3 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/470309e3 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/470309e3 Branch: refs/heads/master Commit: 470309e35bd4f6cf91f1ab51c13755800a728c56 Parents: 2aec6d7 Author: Leif Hedstrom <[email protected]> Authored: Fri Sep 18 20:21:25 2015 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Mon Sep 21 08:42:22 2015 -0600 ---------------------------------------------------------------------- proxy/http/HttpTransactCache.cc | 38 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/470309e3/proxy/http/HttpTransactCache.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransactCache.cc b/proxy/http/HttpTransactCache.cc index d8bde18..f666f9f 100644 --- a/proxy/http/HttpTransactCache.cc +++ b/proxy/http/HttpTransactCache.cc @@ -1336,33 +1336,25 @@ HttpTransactCache::match_response_to_request_conditionals(HTTPHdr *request, HTTP if (raw_etags) { comma_sep_tag_list = request->value_get(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH, &comma_sep_tag_list_len); - } else { - raw_etags = ""; - raw_etags_len = 0; - // no Etag in the response, so there is nothing to match - // against those in If-none-match - goto L1; - } - - if (!comma_sep_tag_list) { - comma_sep_tag_list = ""; - comma_sep_tag_list_len = 0; - } + if (!comma_sep_tag_list) { + comma_sep_tag_list = ""; + comma_sep_tag_list_len = 0; + } - //////////////////////////////////////////////////////////////////////// - // If we have an etag and a if-none-match, we are talking to someone // - // who is doing a 1.1 revalidate. Since this is a GET request with no // - // sub-ranges, we can do a weak validation. // - //////////////////////////////////////////////////////////////////////// - if (do_strings_match_weakly(raw_etags, raw_etags_len, comma_sep_tag_list, comma_sep_tag_list_len)) { - // the response already failed If-modified-since (if one exists) - return HTTP_STATUS_NOT_MODIFIED; - } else { - return response->status_get(); + //////////////////////////////////////////////////////////////////////// + // If we have an etag and a if-none-match, we are talking to someone // + // who is doing a 1.1 revalidate. Since this is a GET request with no // + // sub-ranges, we can do a weak validation. // + //////////////////////////////////////////////////////////////////////// + if (do_strings_match_weakly(raw_etags, raw_etags_len, comma_sep_tag_list, comma_sep_tag_list_len)) { + // the response already failed If-modified-since (if one exists) + return HTTP_STATUS_NOT_MODIFIED; + } else { + return response->status_get(); + } } } -L1: // There is no If-none-match, and If-modified-since failed, // so return NOT_MODIFIED if (response_code != HTTP_STATUS_NONE) {
