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, |