nghttpx: Fix frequent crash with --backend-http-proxy-uri

This commit is contained in:
Tatsuhiro Tsujikawa 2016-11-26 18:36:56 +09:00
parent e9ab75a386
commit 7451f2f212
1 changed files with 10 additions and 11 deletions

View File

@ -481,22 +481,21 @@ int Http2Session::initiate_connection() {
} }
} }
write_ = &Http2Session::connected;
on_write_ = &Http2Session::downstream_write; on_write_ = &Http2Session::downstream_write;
on_read_ = &Http2Session::downstream_read; on_read_ = &Http2Session::downstream_read;
// We have been already connected when no TLS and proxy is used. // We have been already connected when no TLS and proxy is used.
if (state_ != CONNECTED) { if (state_ == PROXY_CONNECTED) {
return connected();
}
write_ = &Http2Session::connected;
state_ = CONNECTING; state_ = CONNECTING;
conn_.wlimit.startw(); conn_.wlimit.startw();
conn_.wt.repeat = downstreamconf.timeout.connect; conn_.wt.repeat = downstreamconf.timeout.connect;
ev_timer_again(conn_.loop, &conn_.wt); ev_timer_again(conn_.loop, &conn_.wt);
} else {
conn_.rlimit.startw();
conn_.again_rt();
}
return 0; return 0;
} }