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

Unified Diff: net/tools/quic/quic_client.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_client_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_client_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698