diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h index decdc9f968f..ce988fda521 100644 --- a/proxy/http/Http1ClientSession.h +++ b/proxy/http/Http1ClientSession.h @@ -76,6 +76,13 @@ class Http1ClientSession : public ProxyClientSession void do_io_shutdown(ShutdownHowTo_t howto) override; void reenable(VIO *vio) override; + bool + allow_half_open() + { + // Only allow half open connections if the not over TLS + return (client_vc && dynamic_cast(client_vc) == nullptr); + } + void set_half_close_flag(bool flag) override { diff --git a/proxy/http/Http1ClientTransaction.cc b/proxy/http/Http1ClientTransaction.cc index 2d4edb07bca..5c5f1759b90 100644 --- a/proxy/http/Http1ClientTransaction.cc +++ b/proxy/http/Http1ClientTransaction.cc @@ -71,5 +71,10 @@ Http1ClientTransaction::transaction_done() bool Http1ClientTransaction::allow_half_open() const { - return current_reader ? current_reader->t_state.txn_conf->allow_half_open > 0 : true; + bool config_allows_it = (current_reader) ? current_reader->t_state.txn_conf->allow_half_open > 0 : true; + if (config_allows_it) { + // Check with the session to make sure the underlying transport allows the half open scenario + return static_cast(parent)->allow_half_open(); + } + return false; }