| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/tools/quic/quic_simple_server.h" | 5 #include "net/tools/quic/quic_simple_server.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 kMinimumFlowControlSendWindow) { | 92 kMinimumFlowControlSendWindow) { |
| 93 config_.SetInitialStreamFlowControlWindowToSend( | 93 config_.SetInitialStreamFlowControlWindowToSend( |
| 94 kInitialStreamFlowControlWindow); | 94 kInitialStreamFlowControlWindow); |
| 95 } | 95 } |
| 96 if (config_.GetInitialSessionFlowControlWindowToSend() == | 96 if (config_.GetInitialSessionFlowControlWindowToSend() == |
| 97 kMinimumFlowControlSendWindow) { | 97 kMinimumFlowControlSendWindow) { |
| 98 config_.SetInitialSessionFlowControlWindowToSend( | 98 config_.SetInitialSessionFlowControlWindowToSend( |
| 99 kInitialSessionFlowControlWindow); | 99 kInitialSessionFlowControlWindow); |
| 100 } | 100 } |
| 101 | 101 |
| 102 scoped_ptr<CryptoHandshakeMessage> scfg(crypto_config_.AddDefaultConfig( | 102 std::unique_ptr<CryptoHandshakeMessage> scfg(crypto_config_.AddDefaultConfig( |
| 103 helper_->GetRandomGenerator(), helper_->GetClock(), | 103 helper_->GetRandomGenerator(), helper_->GetClock(), |
| 104 QuicCryptoServerConfig::ConfigOptions())); | 104 QuicCryptoServerConfig::ConfigOptions())); |
| 105 } | 105 } |
| 106 | 106 |
| 107 QuicSimpleServer::~QuicSimpleServer() {} | 107 QuicSimpleServer::~QuicSimpleServer() {} |
| 108 | 108 |
| 109 int QuicSimpleServer::Listen(const IPEndPoint& address) { | 109 int QuicSimpleServer::Listen(const IPEndPoint& address) { |
| 110 scoped_ptr<UDPServerSocket> socket( | 110 std::unique_ptr<UDPServerSocket> socket( |
| 111 new UDPServerSocket(&net_log_, NetLog::Source())); | 111 new UDPServerSocket(&net_log_, NetLog::Source())); |
| 112 | 112 |
| 113 socket->AllowAddressReuse(); | 113 socket->AllowAddressReuse(); |
| 114 | 114 |
| 115 int rc = socket->Listen(address); | 115 int rc = socket->Listen(address); |
| 116 if (rc < 0) { | 116 if (rc < 0) { |
| 117 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc); | 117 LOG(ERROR) << "Listen() failed: " << ErrorToString(rc); |
| 118 return rc; | 118 return rc; |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 QuicReceivedPacket packet(read_buffer_->data(), result, | 205 QuicReceivedPacket packet(read_buffer_->data(), result, |
| 206 helper_->GetClock()->Now(), false); | 206 helper_->GetClock()->Now(), false); |
| 207 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 207 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
| 208 | 208 |
| 209 StartReading(); | 209 StartReading(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace net | 212 } // namespace net |
| OLD | NEW |