Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iocore/eventsystem/IOBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/SSLUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/memcache/tsmemcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
9 changes: 3 additions & 6 deletions plugins/experimental/uri_signing/uri_signing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions proxy/hdrs/HdrTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/
Expand All @@ -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 ***/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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));
}

/*-------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 0 additions & 5 deletions proxy/http/remap/RemapConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down