| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 printf("%s\n", headers.first_line().as_string().c_str()); | 289 printf("%s\n", headers.first_line().as_string().c_str()); |
| 290 for (BalsaHeaders::const_header_lines_iterator i = | 290 for (BalsaHeaders::const_header_lines_iterator i = |
| 291 headers.header_lines_begin(); | 291 headers.header_lines_begin(); |
| 292 i != headers.header_lines_end(); ++i) { | 292 i != headers.header_lines_end(); ++i) { |
| 293 printf("%s: %s\n", i->first.as_string().c_str(), | 293 printf("%s: %s\n", i->first.as_string().c_str(), |
| 294 i->second.as_string().c_str()); | 294 i->second.as_string().c_str()); |
| 295 } | 295 } |
| 296 printf("%s\n", client_stream->data().c_str()); | 296 printf("%s\n", client_stream->data().c_str()); |
| 297 } | 297 } |
| 298 | 298 |
| 299 QuicPacketCreator::Options* QuicClient::options() { | |
| 300 if (session() == NULL) { | |
| 301 return NULL; | |
| 302 } | |
| 303 return session_->options(); | |
| 304 } | |
| 305 | |
| 306 bool QuicClient::connected() const { | 299 bool QuicClient::connected() const { |
| 307 return session_.get() && session_->connection() && | 300 return session_.get() && session_->connection() && |
| 308 session_->connection()->connected(); | 301 session_->connection()->connected(); |
| 309 } | 302 } |
| 310 | 303 |
| 311 QuicConnectionId QuicClient::GenerateConnectionId() { | 304 QuicConnectionId QuicClient::GenerateConnectionId() { |
| 312 return QuicRandom::GetInstance()->RandUint64(); | 305 return QuicRandom::GetInstance()->RandUint64(); |
| 313 } | 306 } |
| 314 | 307 |
| 315 QuicEpollConnectionHelper* QuicClient::CreateQuicConnectionHelper() { | 308 QuicEpollConnectionHelper* QuicClient::CreateQuicConnectionHelper() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 346 QuicEncryptedPacket packet(buf, bytes_read, false); | 339 QuicEncryptedPacket packet(buf, bytes_read, false); |
| 347 | 340 |
| 348 IPEndPoint client_address(client_ip, client_address_.port()); | 341 IPEndPoint client_address(client_ip, client_address_.port()); |
| 349 session_->connection()->ProcessUdpPacket( | 342 session_->connection()->ProcessUdpPacket( |
| 350 client_address, server_address, packet); | 343 client_address, server_address, packet); |
| 351 return true; | 344 return true; |
| 352 } | 345 } |
| 353 | 346 |
| 354 } // namespace tools | 347 } // namespace tools |
| 355 } // namespace net | 348 } // namespace net |
| OLD | NEW |