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

Unified Diff: net/quic/p2p/quic_p2p_session.cc

Issue 1273233002: Implement QuicChannel and QuicChannelFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | net/quic/p2p/quic_p2p_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/p2p/quic_p2p_session.cc
diff --git a/net/quic/p2p/quic_p2p_session.cc b/net/quic/p2p/quic_p2p_session.cc
index bd8f1c3e37e7878e6e78855ef529da48569a05ae..c8cc5819c0c4dfcff736591838dd526e8ce4d6eb 100644
--- a/net/quic/p2p/quic_p2p_session.cc
+++ b/net/quic/p2p/quic_p2p_session.cc
@@ -67,6 +67,8 @@ QuicP2PStream* QuicP2PSession::CreateOutgoingDynamicStream() {
void QuicP2PSession::OnConnectionClosed(QuicErrorCode error, bool from_peer) {
QuicSession::OnConnectionClosed(error, from_peer);
+ socket_.reset();
+
if (delegate_) {
Delegate* delegate = delegate_;
delegate_ = nullptr;
@@ -98,6 +100,10 @@ int QuicP2PSession::DoRead() {
DCHECK_EQ(read_state_, READ_STATE_DO_READ);
read_state_ = READ_STATE_DO_READ_COMPLETE;
+ if (!socket_) {
+ return net::ERR_SOCKET_NOT_CONNECTED;
+ }
+
return socket_->Read(
read_buffer_.get(), kMaxPacketSize,
base::Bind(&QuicP2PSession::DoReadLoop, base::Unretained(this)));
« no previous file with comments | « no previous file | net/quic/p2p/quic_p2p_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698