diff --git a/iocore/eventsystem/IOBuffer.cc b/iocore/eventsystem/IOBuffer.cc index ac04946b32f..61f71f56086 100644 --- a/iocore/eventsystem/IOBuffer.cc +++ b/iocore/eventsystem/IOBuffer.cc @@ -116,7 +116,7 @@ MIOBuffer::write(IOBufferBlock const *b, int64_t alen, int64_t offset) continue; } int64_t bytes; - if (len < 0 || len >= max_bytes) { + if (len >= max_bytes) { bytes = max_bytes; } else { bytes = len; diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc index 812fd49c656..779f0301d2a 100644 --- a/iocore/net/SSLUtils.cc +++ b/iocore/net/SSLUtils.cc @@ -409,7 +409,7 @@ ssl_client_hello_callback(SSL *s, int *al, void *arg) * The list in practice only has a single element, so we only consider * the first one. */ - if (remaining != 0 && *p++ == TLSEXT_NAMETYPE_host_name) { + if (*p++ == TLSEXT_NAMETYPE_host_name) { remaining--; /* Now we can finally pull out the byte array with the actual hostname. */ if (remaining > 2) { diff --git a/plugins/experimental/memcache/tsmemcache.cc b/plugins/experimental/memcache/tsmemcache.cc index f8e5789227a..bdb2ebe5512 100644 --- a/plugins/experimental/memcache/tsmemcache.cc +++ b/plugins/experimental/memcache/tsmemcache.cc @@ -1628,7 +1628,7 @@ TSPluginInit(int argc, const char *argv[]) if (argc < 2) { TSError("[tsmemcache] Usage: tsmemcache.so [accept_port]\n"); goto error; - } else if (argc > 1) { + } else { int port = atoi(argv[1]); if (!port) { TSError("[tsmemcache] bad accept_port '%s'\n", argv[1]); diff --git a/plugins/experimental/uri_signing/uri_signing.c b/plugins/experimental/uri_signing/uri_signing.c index 30c8e4532e3..fe6793bee84 100644 --- a/plugins/experimental/uri_signing/uri_signing.c +++ b/plugins/experimental/uri_signing/uri_signing.c @@ -188,9 +188,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri) TSHandleMLocRelease(mbuf, TS_NULL_MLOC, ul); PluginDebug("Processing request for %.*s.", url_ct, url); - if (cpi < max_cpi) { - checkpoints[cpi++] = mark_timer(&t); - } + checkpoints[cpi++] = mark_timer(&t); int strip_size = url_ct + 1; strip_uri = (char *)TSmalloc(strip_size); @@ -199,9 +197,8 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri) size_t strip_ct; cjose_jws_t *jws = get_jws_from_uri(url, url_ct, package, strip_uri, strip_size, &strip_ct); - if (cpi < max_cpi) { - checkpoints[cpi++] = mark_timer(&t); - } + checkpoints[cpi++] = mark_timer(&t); + int checked_cookies = 0; if (!jws) { check_cookies: diff --git a/proxy/hdrs/HdrTest.cc b/proxy/hdrs/HdrTest.cc index b0f84d39f11..53b5736e662 100644 --- a/proxy/hdrs/HdrTest.cc +++ b/proxy/hdrs/HdrTest.cc @@ -541,8 +541,6 @@ HdrTest::test_http_aux(const char *request, const char *response) const char *start; const char *end; - int status = 1; - printf(" <<< MUST BE HAND-VERIFIED FOR FULL BENEFIT >>>\n\n"); /*** (1) parse the request string into req_hdr ***/ @@ -565,7 +563,7 @@ HdrTest::test_http_aux(const char *request, const char *response) if (err == PARSE_RESULT_ERROR) { req_hdr.destroy(); rsp_hdr.destroy(); - return (failures_to_status("test_http_aux", (status == 0))); + return (failures_to_status("test_http_aux", false)); } /*** useless copy to exercise copy function ***/ @@ -606,7 +604,7 @@ HdrTest::test_http_aux(const char *request, const char *response) if (err == PARSE_RESULT_ERROR) { req_hdr.destroy(); rsp_hdr.destroy(); - return (failures_to_status("test_http_aux", (status == 0))); + return (failures_to_status("test_http_aux", false)); } http_parser_clear(&parser); @@ -655,7 +653,7 @@ HdrTest::test_http_aux(const char *request, const char *response) req_hdr.destroy(); rsp_hdr.destroy(); - return (failures_to_status("test_http_aux", (status == 0))); + return (failures_to_status("test_http_aux", false)); } int @@ -1520,8 +1518,6 @@ HdrTest::test_http() int HdrTest::test_http_mutation() { - int status = 1; - bri_box("test_http_mutation"); printf(" <<< MUST BE HAND-VERIFIED FOR FULL BENEFIT>>>\n\n"); @@ -1599,7 +1595,7 @@ HdrTest::test_http_mutation() resp_hdr.destroy(); - return (failures_to_status("test_http_mutation", (status == 0))); + return (failures_to_status("test_http_mutation", false)); } /*------------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index c03bd23cff4..a1df461eab5 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -4305,7 +4305,7 @@ HttpSM::parse_range_and_compare(MIMEField *field, int64_t content_length) ; } - if (s < e || start < 0) { + if (s < e) { t_state.range_setup = HttpTransact::RANGE_NONE; goto Lfaild; } @@ -4345,7 +4345,7 @@ HttpSM::parse_range_and_compare(MIMEField *field, int64_t content_length) ; } - if (s < e || end < 0) { + if (s < e) { t_state.range_setup = HttpTransact::RANGE_NONE; goto Lfaild; } diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc index 985aee7779c..ecba86328b9 100644 --- a/proxy/http/remap/RemapConfig.cc +++ b/proxy/http/remap/RemapConfig.cc @@ -845,7 +845,6 @@ process_regex_mapping_config(const char *from_host_lower, url_mapping *new_mappi const char *to_host; int to_host_len; int substitution_id; - int substitution_count = 0; int captures; reg_map->to_url_host_template = nullptr; @@ -875,10 +874,6 @@ process_regex_mapping_config(const char *from_host_lower, url_mapping *new_mappi to_host = new_mapping->toURL.host_get(&to_host_len); for (int i = 0; i < (to_host_len - 1); ++i) { if (to_host[i] == '$') { - if (substitution_count > UrlRewrite::MAX_REGEX_SUBS) { - Warning("Cannot have more than %d substitutions in mapping with host [%s]", UrlRewrite::MAX_REGEX_SUBS, from_host_lower); - goto lFail; - } substitution_id = to_host[i + 1] - '0'; if ((substitution_id < 0) || (substitution_id > captures)) { Warning("Substitution id [%c] has no corresponding capture pattern in regex [%s]", to_host[i + 1], from_host_lower);