nghttpx: Fix possible data loss on backend connection upgrade

This commit is contained in:
Tatsuhiro Tsujikawa 2016-01-27 15:26:46 +09:00
parent 1739b5a0e6
commit ad93cea544
1 changed files with 5 additions and 5 deletions

View File

@ -760,11 +760,6 @@ int HttpDownstreamConnection::on_read() {
return -1; return -1;
} }
if (downstream_->response_buf_full()) {
downstream_->pause_read(SHRPX_NO_BUFFER);
return 0;
}
if (downstream_->get_upgraded()) { if (downstream_->get_upgraded()) {
if (nproc < static_cast<size_t>(nread)) { if (nproc < static_cast<size_t>(nread)) {
// Data from buf.data() + nproc are for upgraded protocol. // Data from buf.data() + nproc are for upgraded protocol.
@ -783,6 +778,11 @@ int HttpDownstreamConnection::on_read() {
// upgrade. // upgrade.
return on_read(); return on_read();
} }
if (downstream_->response_buf_full()) {
downstream_->pause_read(SHRPX_NO_BUFFER);
return 0;
}
} }
} }