nghttpx: Set timeout to underlying bufferevent

Setting write timeout to filter bufferevent does not work as intended.
It timeouts even when there is no data to write.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-01 02:25:23 +09:00
parent 4f7223e89f
commit 7e5567341f
1 changed files with 7 additions and 1 deletions

View File

@ -361,7 +361,13 @@ void ClientHandler::set_bev_cb
void ClientHandler::set_upstream_timeouts(const timeval *read_timeout,
const timeval *write_timeout)
{
bufferevent_set_timeouts(bev_, read_timeout, write_timeout);
auto bev = bufferevent_get_underlying(bev_);
if(!bev) {
bev = bev_;
}
bufferevent_set_timeouts(bev, read_timeout, write_timeout);
}
int ClientHandler::validate_next_proto()