Index: net/tools/quic/quic_client.cc |
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc |
index d7d35c8170b1d6add682a9cc668d5a59635ef9f1..eb86c7f4c181e9e14ba78c9bf55ca906d7198331 100644 |
--- a/net/tools/quic/quic_client.cc |
+++ b/net/tools/quic/quic_client.cc |
@@ -76,9 +76,8 @@ QuicClient::~QuicClient() { |
session()->connection()->SendConnectionClosePacket( |
QUIC_PEER_GOING_AWAY, ""); |
} |
- if (fd_ > 0) { |
- epoll_server_->UnregisterFD(fd_); |
- } |
+ |
+ CleanUpUDPSocket(); |
} |
bool QuicClient::Initialize() { |
@@ -87,10 +86,6 @@ bool QuicClient::Initialize() { |
// If an initial flow control window has not explicitly been set, then use the |
// same value that Chrome uses: 10 Mb. |
const uint32 kInitialFlowControlWindow = 10 * 1024 * 1024; // 10 Mb |
- if (config_.GetInitialFlowControlWindowToSend() == |
- kMinimumFlowControlSendWindow) { |
- config_.SetInitialFlowControlWindowToSend(kInitialFlowControlWindow); |
- } |
if (config_.GetInitialStreamFlowControlWindowToSend() == |
kMinimumFlowControlSendWindow) { |
config_.SetInitialStreamFlowControlWindowToSend(kInitialFlowControlWindow); |
@@ -236,12 +231,20 @@ void QuicClient::Disconnect() { |
if (connected()) { |
session()->connection()->SendConnectionClose(QUIC_PEER_GOING_AWAY); |
} |
- epoll_server_->UnregisterFD(fd_); |
- close(fd_); |
- fd_ = -1; |
+ |
+ CleanUpUDPSocket(); |
+ |
initialized_ = false; |
} |
+void QuicClient::CleanUpUDPSocket() { |
+ if (fd_ > -1) { |
+ epoll_server_->UnregisterFD(fd_); |
+ close(fd_); |
+ fd_ = -1; |
+ } |
+} |
+ |
void QuicClient::SendRequestsAndWaitForResponse( |
const base::CommandLine::StringVector& args) { |
for (size_t i = 0; i < args.size(); ++i) { |