Commit 7451f2f2 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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

parent e9ab75a3
...@@ -481,23 +481,22 @@ int Http2Session::initiate_connection() { ...@@ -481,23 +481,22 @@ 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) {
state_ = CONNECTING; return connected();
conn_.wlimit.startw();
conn_.wt.repeat = downstreamconf.timeout.connect;
ev_timer_again(conn_.loop, &conn_.wt);
} else {
conn_.rlimit.startw();
conn_.again_rt();
} }
write_ = &Http2Session::connected;
state_ = CONNECTING;
conn_.wlimit.startw();
conn_.wt.repeat = downstreamconf.timeout.connect;
ev_timer_again(conn_.loop, &conn_.wt);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment