OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/socket/tcp_socket.h" | 5 #include "net/socket/tcp_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <netinet/tcp.h> | 8 #include <netinet/tcp.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 | 10 |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 void TCPSocketLibevent::EndLoggingMultipleConnectAttempts(int net_error) { | 462 void TCPSocketLibevent::EndLoggingMultipleConnectAttempts(int net_error) { |
463 if (logging_multiple_connect_attempts_) { | 463 if (logging_multiple_connect_attempts_) { |
464 LogConnectEnd(net_error); | 464 LogConnectEnd(net_error); |
465 logging_multiple_connect_attempts_ = false; | 465 logging_multiple_connect_attempts_ = false; |
466 } else { | 466 } else { |
467 NOTREACHED(); | 467 NOTREACHED(); |
468 } | 468 } |
469 } | 469 } |
470 | 470 |
| 471 int TCPSocketLibevent::socket() const { |
| 472 return socket_->socket_fd(); |
| 473 } |
| 474 |
471 void TCPSocketLibevent::AcceptCompleted( | 475 void TCPSocketLibevent::AcceptCompleted( |
472 scoped_ptr<TCPSocketLibevent>* tcp_socket, | 476 scoped_ptr<TCPSocketLibevent>* tcp_socket, |
473 IPEndPoint* address, | 477 IPEndPoint* address, |
474 const CompletionCallback& callback, | 478 const CompletionCallback& callback, |
475 int rv) { | 479 int rv) { |
476 DCHECK_NE(ERR_IO_PENDING, rv); | 480 DCHECK_NE(ERR_IO_PENDING, rv); |
477 callback.Run(HandleAcceptCompleted(tcp_socket, address, rv)); | 481 callback.Run(HandleAcceptCompleted(tcp_socket, address, rv)); |
478 } | 482 } |
479 | 483 |
480 int TCPSocketLibevent::HandleAcceptCompleted( | 484 int TCPSocketLibevent::HandleAcceptCompleted( |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 744 } |
741 } else { | 745 } else { |
742 tcp_fastopen_status_ = | 746 tcp_fastopen_status_ = |
743 (tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN ? | 747 (tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN ? |
744 TCP_FASTOPEN_SYN_DATA_GETSOCKOPT_FAILED : | 748 TCP_FASTOPEN_SYN_DATA_GETSOCKOPT_FAILED : |
745 TCP_FASTOPEN_NO_SYN_DATA_GETSOCKOPT_FAILED); | 749 TCP_FASTOPEN_NO_SYN_DATA_GETSOCKOPT_FAILED); |
746 } | 750 } |
747 } | 751 } |
748 | 752 |
749 } // namespace net | 753 } // namespace net |
OLD | NEW |