Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: net/quic/chromium/quic_http_stream.cc

Issue 2937113002: Fix QuicHttpStream reporting negative sent bytes. (Closed)
Patch Set: Oops Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/chromium/quic_http_stream.cc
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc
index 140dbc0af1f2284cfa956dcb514caa5cc1dc5237..8e27f4386b278c6eda60be6263b31ddf99515c2d 100644
--- a/net/quic/chromium/quic_http_stream.cc
+++ b/net/quic/chromium/quic_http_stream.cc
@@ -608,12 +608,13 @@ int QuicHttpStream::DoSendHeaders() {
bool has_upload_data = request_body_stream_ != nullptr;
next_state_ = STATE_SEND_HEADERS_COMPLETE;
- size_t frame_len = stream_->WriteHeaders(std::move(request_headers_),
- !has_upload_data, nullptr);
- headers_bytes_sent_ += frame_len;
+ int rv = stream_->WriteHeaders(std::move(request_headers_), !has_upload_data,
+ nullptr);
+ if (rv > 0)
+ headers_bytes_sent_ += rv;
request_headers_ = SpdyHeaderBlock();
- return static_cast<int>(frame_len);
+ return rv;
}
int QuicHttpStream::DoSendHeadersComplete(int rv) {
« no previous file with comments | « no previous file | net/quic/chromium/quic_http_stream_test.cc » ('j') | net/quic/chromium/quic_http_stream_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698