mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-06 18:18:52 +08:00
nghttpx: Fix bug that causes connection failure with backend proxy URI
This is a regression when we introduced SSL/TLS session resumption in HTTP/2 backend. Before the introduction of session resumption, conn_.tls.ssl is always nullptr when connection is made to proxy. But we have to keep conn_.tls.ssl to enable session resumption, so our code breaks when it is reused. This commit fixes this issue. See GH-421
This commit is contained in:
@@ -1569,13 +1569,6 @@ int Http2Session::connected() {
|
|||||||
|
|
||||||
conn_.rlimit.startw();
|
conn_.rlimit.startw();
|
||||||
|
|
||||||
if (conn_.tls.ssl) {
|
|
||||||
read_ = &Http2Session::tls_handshake;
|
|
||||||
write_ = &Http2Session::tls_handshake;
|
|
||||||
|
|
||||||
return do_write();
|
|
||||||
}
|
|
||||||
|
|
||||||
read_ = &Http2Session::read_clear;
|
read_ = &Http2Session::read_clear;
|
||||||
write_ = &Http2Session::write_clear;
|
write_ = &Http2Session::write_clear;
|
||||||
|
|
||||||
@@ -1583,6 +1576,13 @@ int Http2Session::connected() {
|
|||||||
return do_write();
|
return do_write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conn_.tls.ssl) {
|
||||||
|
read_ = &Http2Session::tls_handshake;
|
||||||
|
write_ = &Http2Session::tls_handshake;
|
||||||
|
|
||||||
|
return do_write();
|
||||||
|
}
|
||||||
|
|
||||||
if (connection_made() != 0) {
|
if (connection_made() != 0) {
|
||||||
state_ = CONNECT_FAILING;
|
state_ = CONNECT_FAILING;
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user