nghttpx: Fix handling of pending data

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-02 13:42:32 +09:00
parent 82320d6e55
commit d157744fb2
2 changed files with 2 additions and 2 deletions

View File

@ -1417,7 +1417,7 @@ int Http2Session::downstream_write() {
auto n = std::min(wb_.wleft(), data_pendinglen_);
wb_.write(data_pending_, n);
if (n < data_pendinglen_) {
data_pendinglen_ += n;
data_pending_ += n;
data_pendinglen_ -= n;
return 0;
}

View File

@ -726,7 +726,7 @@ int Http2Upstream::on_write() {
auto n = std::min(wb->wleft(), data_pendinglen_);
wb->write(data_pending_, n);
if (n < data_pendinglen_) {
data_pendinglen_ += n;
data_pending_ += n;
data_pendinglen_ -= n;
return 0;
}