Index: net/tools/quic/quic_client.cc |
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc |
index 7d033904ff6a5064a070f84cb66552b27000c548..ff8502f012d6fb4c23d34ac48a39044fa9d32a6f 100644 |
--- a/net/tools/quic/quic_client.cc |
+++ b/net/tools/quic/quic_client.cc |
@@ -127,7 +127,6 @@ bool QuicClient::Connect() { |
return session_->connection()->connected(); |
} |
- |
bool QuicClient::StartConnect() { |
DCHECK(!connected() && initialized_); |
@@ -154,7 +153,6 @@ void QuicClient::Disconnect() { |
epoll_server_.UnregisterFD(fd_); |
close(fd_); |
fd_ = -1; |
- session_.reset(); |
} |
void QuicClient::SendRequestsAndWaitForResponse(int argc, char *argv[]) { |
@@ -192,10 +190,10 @@ void QuicClient::OnEvent(int fd, EpollEvent* event) { |
DCHECK_EQ(fd, fd_); |
if (event->in_events & EPOLLIN) { |
- while (ReadAndProcessPacket()) { |
+ while (connected() && ReadAndProcessPacket()) { |
} |
} |
- if (event->in_events & EPOLLOUT) { |
+ if (connected() && (event->in_events & EPOLLOUT)) { |
session_->connection()->OnCanWrite(); |
} |
if (event->in_events & EPOLLERR) { |