OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_client.h" | 5 #include "net/tools/quic/quic_client.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <netinet/in.h> | 8 #include <netinet/in.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/epoll.h> | 10 #include <sys/epoll.h> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DummyPacketWriterFactory factory(writer); | 192 DummyPacketWriterFactory factory(writer); |
193 | 193 |
194 session_.reset(new QuicClientSession( | 194 session_.reset(new QuicClientSession( |
195 config_, | 195 config_, |
196 new QuicConnection(GenerateConnectionId(), | 196 new QuicConnection(GenerateConnectionId(), |
197 server_address_, | 197 server_address_, |
198 helper_.get(), | 198 helper_.get(), |
199 factory, | 199 factory, |
200 /* owns_writer= */ false, | 200 /* owns_writer= */ false, |
201 /* is_server= */ false, | 201 /* is_server= */ false, |
202 supported_versions_), | 202 server_id_.is_https(), |
203 server_id_.is_https())); | 203 supported_versions_))); |
204 | 204 |
205 // Reset |writer_| after |session_| so that the old writer outlives the old | 205 // Reset |writer_| after |session_| so that the old writer outlives the old |
206 // session. | 206 // session. |
207 if (writer_.get() != writer) { | 207 if (writer_.get() != writer) { |
208 writer_.reset(writer); | 208 writer_.reset(writer); |
209 } | 209 } |
210 session_->InitializeSession(server_id_, &crypto_config_); | 210 session_->InitializeSession(server_id_, &crypto_config_); |
211 return session_->CryptoConnect(); | 211 return session_->CryptoConnect(); |
212 } | 212 } |
213 | 213 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 QuicEncryptedPacket packet(buf, bytes_read, false); | 356 QuicEncryptedPacket packet(buf, bytes_read, false); |
357 | 357 |
358 IPEndPoint client_address(client_ip, client_address_.port()); | 358 IPEndPoint client_address(client_ip, client_address_.port()); |
359 session_->connection()->ProcessUdpPacket( | 359 session_->connection()->ProcessUdpPacket( |
360 client_address, server_address, packet); | 360 client_address, server_address, packet); |
361 return true; | 361 return true; |
362 } | 362 } |
363 | 363 |
364 } // namespace tools | 364 } // namespace tools |
365 } // namespace net | 365 } // namespace net |
OLD | NEW |