nghttpx: Make stream timeout disable by default

It might be useful to clean the unused stream out to make up the room
for new streams.  On the other hand, proxy should maintain the
connection between upstream client and downstream server and they have
the timeout for their own.  Proxy just reacts to their decision.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-10 00:08:44 +09:00
parent 1a2e50ca08
commit 93ed89df5f
2 changed files with 18 additions and 7 deletions

View File

@ -489,10 +489,10 @@ void fill_default_config()
mod_config()->downstream_write_timeout = {30, 0};
// Read timeout for HTTP/2 stream
mod_config()->stream_read_timeout = {30, 0};
mod_config()->stream_read_timeout = {0, 0};
// Write timeout for HTTP/2 stream
mod_config()->stream_write_timeout = {30, 0};
mod_config()->stream_write_timeout = {0, 0};
// Timeout for pooled (idle) connections
mod_config()->downstream_idle_read_timeout = {60, 0};
@ -683,11 +683,12 @@ Timeout:
<< get_config()->upstream_write_timeout.tv_sec << R"(
--stream-read-timeout=<SEC>
Specify read timeout for HTTP/2 and SPDY streams.
0 means no timeout.
Default: )"
<< get_config()->stream_read_timeout.tv_sec << R"(
--stream-write-timeout=<SEC>
Specify write timeout for HTTP/2 and SPDY
streams.
streams. 0 means no timeout.
Default: )"
<< get_config()->stream_write_timeout.tv_sec << R"(
--backend-read-timeout=<SEC>

View File

@ -949,8 +949,13 @@ void Downstream::init_upstream_timer()
{
auto evbase = upstream_->get_client_handler()->get_evbase();
upstream_rtimerev_ = init_timer(evbase, upstream_rtimeoutcb, this);
upstream_wtimerev_ = init_timer(evbase, upstream_wtimeoutcb, this);
if(get_config()->stream_read_timeout.tv_sec > 0) {
upstream_rtimerev_ = init_timer(evbase, upstream_rtimeoutcb, this);
}
if(get_config()->stream_write_timeout.tv_sec > 0) {
upstream_wtimerev_ = init_timer(evbase, upstream_wtimeoutcb, this);
}
}
namespace {
@ -1074,8 +1079,13 @@ void Downstream::init_downstream_timer()
{
auto evbase = upstream_->get_client_handler()->get_evbase();
downstream_rtimerev_ = init_timer(evbase, downstream_rtimeoutcb, this);
downstream_wtimerev_ = init_timer(evbase, downstream_wtimeoutcb, this);
if(get_config()->stream_read_timeout.tv_sec > 0) {
downstream_rtimerev_ = init_timer(evbase, downstream_rtimeoutcb, this);
}
if(get_config()->stream_write_timeout.tv_sec > 0) {
downstream_wtimerev_ = init_timer(evbase, downstream_wtimeoutcb, this);
}
}
void Downstream::reset_downstream_rtimer()