Fix clang warnings

This commit is contained in:
Tatsuhiro Tsujikawa 2013-09-08 23:16:08 +09:00
parent 72802b92c5
commit 5cd1d4f0d6
3 changed files with 4 additions and 21 deletions

View File

@ -833,9 +833,8 @@ void fill_callback(nghttp2_session_callbacks& callbacks, const Config *config)
class ListenEventHandler { class ListenEventHandler {
public: public:
ListenEventHandler(Sessions *sessions, int fd, int64_t *session_id_seed_ptr) ListenEventHandler(Sessions *sessions, int64_t *session_id_seed_ptr)
: sessions_(sessions), : sessions_(sessions),
fd_(fd),
session_id_seed_ptr_(session_id_seed_ptr) session_id_seed_ptr_(session_id_seed_ptr)
{} {}
void accept_connection(int fd, sockaddr *addr, int addrlen) void accept_connection(int fd, sockaddr *addr, int addrlen)
@ -868,7 +867,6 @@ public:
} }
private: private:
Sessions *sessions_; Sessions *sessions_;
int fd_;
int64_t *session_id_seed_ptr_; int64_t *session_id_seed_ptr_;
}; };
@ -960,7 +958,7 @@ int start_listen(event_base *evbase, Sessions *sessions,
auto evlistener = evconnlistener_new auto evlistener = evconnlistener_new
(evbase, (evbase,
evlistener_acceptcb, 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, LEV_OPT_REUSEABLE | LEV_OPT_CLOSE_ON_FREE,
256, 256,
fd); fd);

View File

@ -33,7 +33,8 @@
using namespace nghttp2; 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 { namespace shrpx {

View File

@ -143,20 +143,6 @@ void check_expect_100_continue(bool *res,
} }
} // namespace } // 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 { namespace {
auto name_less = [](const Headers::value_type& lhs, auto name_less = [](const Headers::value_type& lhs,
const Headers::value_type& rhs) const Headers::value_type& rhs)
@ -218,7 +204,6 @@ void Downstream::set_last_request_header_value(const std::string& value)
item.second = value; item.second = value;
check_transfer_encoding_chunked(&chunked_request_, item); check_transfer_encoding_chunked(&chunked_request_, item);
check_expect_100_continue(&request_expect_100_continue_, 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 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(); Headers::value_type &item = response_headers_.back();
item.second = value; item.second = value;
check_transfer_encoding_chunked(&chunked_response_, item); check_transfer_encoding_chunked(&chunked_response_, item);
//check_connection_close(&response_connection_close_, item);
} }
bool Downstream::get_response_header_key_prev() const bool Downstream::get_response_header_key_prev() const