Skip to content

Commit

Permalink
fix: don't call ReadRawDataComplete if it's not necessary (#15185)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenca authored and codebytere committed Oct 17, 2018
1 parent d43ef97 commit 4d085c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion atom/browser/net/url_request_stream_job.cc
Expand Up @@ -153,13 +153,17 @@ void URLRequestStreamJob::OnData(std::vector<char>&& buffer) { // NOLINT
if (pending_buf_) {
int len = BufferCopy(&write_buffer_, pending_buf_.get(), pending_buf_size_);
write_buffer_.erase(write_buffer_.begin(), write_buffer_.begin() + len);
pending_buf_ = nullptr;
pending_buf_size_ = 0;
ReadRawDataComplete(len);
}
}

void URLRequestStreamJob::OnEnd() {
ended_ = true;
ReadRawDataComplete(0);
if (pending_buf_) {
ReadRawDataComplete(0);
}
}

void URLRequestStreamJob::OnError(int error) {
Expand Down

0 comments on commit 4d085c4

Please sign in to comment.