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

Unified Diff: net/quic/reliable_quic_stream.cc

Issue 14287009: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with Tot Created 7 years, 8 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
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/reliable_quic_stream.cc
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index 3e1b821ff338d650297c1f4ab842247323f16311..adce4082ab3cb4bec5f33c6c48767be8325d707a 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -66,6 +66,9 @@ void ReliableQuicStream::OnStreamReset(QuicRstStreamErrorCode error) {
}
void ReliableQuicStream::ConnectionClose(QuicErrorCode error, bool from_peer) {
+ if (IsClosed()) {
+ return;
+ }
if (error != QUIC_NO_ERROR) {
stream_error_ = QUIC_STREAM_CONNECTION_ERROR;
connection_error_ = error;
@@ -95,6 +98,10 @@ bool ReliableQuicStream::IsHalfClosed() const {
return sequencer_.IsHalfClosed();
}
+bool ReliableQuicStream::IsClosed() const {
+ return write_side_closed_ && (read_side_closed_ || IsHalfClosed());
+}
+
bool ReliableQuicStream::HasBytesToRead() const {
return sequencer_.HasBytesToRead();
}
@@ -195,6 +202,9 @@ void ReliableQuicStream::CloseWriteSide() {
}
void ReliableQuicStream::OnClose() {
+ CloseReadSide();
+ CloseWriteSide();
+
if (visitor_) {
Visitor* visitor = visitor_;
// Calling Visitor::OnClose() may result the destruction of the visitor,
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698