diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index 46d9a058..7c5a81a5 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -760,11 +760,6 @@ int HttpDownstreamConnection::on_read() { return -1; } - if (downstream_->response_buf_full()) { - downstream_->pause_read(SHRPX_NO_BUFFER); - return 0; - } - if (downstream_->get_upgraded()) { if (nproc < static_cast(nread)) { // Data from buf.data() + nproc are for upgraded protocol. @@ -783,6 +778,11 @@ int HttpDownstreamConnection::on_read() { // upgrade. return on_read(); } + + if (downstream_->response_buf_full()) { + downstream_->pause_read(SHRPX_NO_BUFFER); + return 0; + } } }