nghttpx: Fix stall when TLS follows after proxy protocol

This fixes that nghttpx stalls when TLS handshake and data follow
after proxy protocol header and no extra read notification is
triggered (e.g., just small 1 HTTP request).
This commit is contained in:
Tatsuhiro Tsujikawa 2020-07-13 23:39:17 +09:00
parent 7b46edb483
commit f1d8547b29
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ void RateLimit::stopw() {
}
void RateLimit::handle_tls_pending_read() {
if (!conn_ || !conn_->tls.ssl || !conn_->tls.initial_handshake_done ||
if (!conn_ || !conn_->tls.ssl ||
(conn_->tls.rbuf.rleft() == 0 && !conn_->tls.initial_handshake_done) ||
(SSL_pending(conn_->tls.ssl) == 0 && conn_->tls.rbuf.rleft() == 0 &&
conn_->tls.earlybuf.rleft() == 0)) {
return;