Skip to content

Commit

Permalink
Properly shut down a QUIC session before it is destroyed.
Browse files Browse the repository at this point in the history
Review URL: https://codereview.chromium.org/70613004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234844 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rch@chromium.org committed Nov 13, 2013
1 parent 1653521 commit fa0f449
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/quic/quic_client_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ void QuicClientSession::OnConnectionClosed(QuicErrorCode error,
}
socket_->Close();
QuicSession::OnConnectionClosed(error, from_peer);
DCHECK(streams()->empty());
CloseAllStreams(ERR_UNEXPECTED);
CloseAllObservers(ERR_UNEXPECTED);
NotifyFactoryOfSessionClosedLater();
}

Expand Down
4 changes: 4 additions & 0 deletions net/quic/quic_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "base/logging.h"
#include "base/stl_util.h"
#include "net/base/net_errors.h"
#include "net/quic/crypto/quic_decrypter.h"
#include "net/quic/crypto/quic_encrypter.h"
#include "net/quic/iovector.h"
Expand Down Expand Up @@ -1338,6 +1339,9 @@ bool QuicConnection::WritePacket(EncryptionLevel level,
WriteResult result =
writer_->WritePacket(encrypted->data(), encrypted->length(),
self_address().address(), peer_address(), this);
if (result.error_code == ERR_IO_PENDING) {
DCHECK_EQ(WRITE_STATUS_BLOCKED, result.status);
}
if (debug_visitor_) {
// Pass the write result to the visitor.
debug_visitor_->OnPacketSent(sequence_number, level, *encrypted, result);
Expand Down

0 comments on commit fa0f449

Please sign in to comment.