From 5cd1d4f0d673c351aca6e73d00c715401f116c1a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 8 Sep 2013 23:16:08 +0900 Subject: [PATCH] Fix clang warnings --- src/HttpServer.cc | 6 ++---- src/http2_test.cc | 3 ++- src/shrpx_downstream.cc | 16 ---------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 28aad538..24193327 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -833,9 +833,8 @@ void fill_callback(nghttp2_session_callbacks& callbacks, const Config *config) class ListenEventHandler { public: - ListenEventHandler(Sessions *sessions, int fd, int64_t *session_id_seed_ptr) + ListenEventHandler(Sessions *sessions, int64_t *session_id_seed_ptr) : sessions_(sessions), - fd_(fd), session_id_seed_ptr_(session_id_seed_ptr) {} void accept_connection(int fd, sockaddr *addr, int addrlen) @@ -868,7 +867,6 @@ public: } private: Sessions *sessions_; - int fd_; int64_t *session_id_seed_ptr_; }; @@ -960,7 +958,7 @@ int start_listen(event_base *evbase, Sessions *sessions, auto evlistener = evconnlistener_new (evbase, evlistener_acceptcb, - new ListenEventHandler(sessions, fd, session_id_seed_ptr), + new ListenEventHandler(sessions, session_id_seed_ptr), LEV_OPT_REUSEABLE | LEV_OPT_CLOSE_ON_FREE, 256, fd); diff --git a/src/http2_test.cc b/src/http2_test.cc index aaf59926..e3cf7682 100644 --- a/src/http2_test.cc +++ b/src/http2_test.cc @@ -33,7 +33,8 @@ using namespace nghttp2; -#define MAKE_NV(K, V) {(uint8_t*)K, (uint8_t*)V, strlen(K), strlen(V)} +#define MAKE_NV(K, V) {(uint8_t*)K, (uint8_t*)V, \ + (uint16_t)strlen(K), (uint16_t)strlen(V)} namespace shrpx { diff --git a/src/shrpx_downstream.cc b/src/shrpx_downstream.cc index c9b52933..c693262c 100644 --- a/src/shrpx_downstream.cc +++ b/src/shrpx_downstream.cc @@ -143,20 +143,6 @@ void check_expect_100_continue(bool *res, } } // namespace -namespace { -void check_connection_close(bool *connection_close, - const Headers::value_type &item) -{ - if(util::strieq(item.first.c_str(), "connection")) { - if(util::strifind(item.second.c_str(), "close")) { - *connection_close = true; - } else if(util::strifind(item.second.c_str(), "keep-alive")) { - *connection_close = false; - } - } -} -} // namespace - namespace { auto name_less = [](const Headers::value_type& lhs, const Headers::value_type& rhs) @@ -218,7 +204,6 @@ void Downstream::set_last_request_header_value(const std::string& value) item.second = value; check_transfer_encoding_chunked(&chunked_request_, item); check_expect_100_continue(&request_expect_100_continue_, item); - //check_connection_close(&request_connection_close_, item); } bool Downstream::get_request_header_key_prev() const @@ -402,7 +387,6 @@ void Downstream::set_last_response_header_value(const std::string& value) Headers::value_type &item = response_headers_.back(); item.second = value; check_transfer_encoding_chunked(&chunked_response_, item); - //check_connection_close(&response_connection_close_, item); } bool Downstream::get_response_header_key_prev() const