diff --git a/src/h2load.cc b/src/h2load.cc index fc183204..76e8649f 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -801,6 +801,7 @@ TimeStat compute_time_stat(const std::vector &samples) { a = na; } + assert(n > 0); res.mean = Duration(sum / n); res.sd = Duration(static_cast(sqrt(q / n))); res.within_sd = within_sd(samples, res.mean, res.sd); diff --git a/src/http2.cc b/src/http2.cc index b47787da..bba0464a 100644 --- a/src/http2.cc +++ b/src/http2.cc @@ -832,7 +832,7 @@ parse_next_link_header_once(const char *first, const char *last) { static constexpr size_t PLLEN = sizeof(PL) - 1; if (first + PLLEN == last) { if (std::equal(PL, PL + PLLEN, first, util::CaseCmp())) { - ok = true; + // ok = true; // this is the end of sequence return {{{url_first, url_last}}, last}; } @@ -842,7 +842,7 @@ parse_next_link_header_once(const char *first, const char *last) { if (!std::equal(PL, PL + PLLEN, first, util::CaseCmp())) { break; } - ok = true; + // ok = true; // skip including ',' first += PLLEN + 1; return {{{url_first, url_last}}, first}; diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 57d8462b..c3431f87 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -167,6 +167,8 @@ void on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type, size_t header_buffer = 0; for (size_t i = 0; nv[i]; i += 2) { ++num_headers; + // shut up scan-build + assert(nv[i + 1]); header_buffer += strlen(nv[i]) + strlen(nv[i + 1]); }