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/flip_server/acceptor_thread.h" | 5 #include "net/tools/flip_server/acceptor_thread.h" |
6 | 6 |
7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
8 #include <netinet/tcp.h> // For TCP_NODELAY | 8 #include <netinet/tcp.h> // For TCP_NODELAY |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (server_connection == NULL) { | 98 if (server_connection == NULL) { |
99 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Acceptor: Closing fd " << server_fd; | 99 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Acceptor: Closing fd " << server_fd; |
100 close(server_fd); | 100 close(server_fd); |
101 return; | 101 return; |
102 } | 102 } |
103 std::string remote_ip = inet_ntoa(remote_addr->sin_addr); | 103 std::string remote_ip = inet_ntoa(remote_addr->sin_addr); |
104 server_connection->InitSMConnection(this, | 104 server_connection->InitSMConnection(this, |
105 NULL, | 105 NULL, |
106 &epoll_server_, | 106 &epoll_server_, |
107 server_fd, | 107 server_fd, |
108 "", "", remote_ip, | 108 std::string(), |
| 109 std::string(), |
| 110 remote_ip, |
109 use_ssl_); | 111 use_ssl_); |
110 if (server_connection->initialized()) | 112 if (server_connection->initialized()) |
111 active_server_connections_.push_back(server_connection); | 113 active_server_connections_.push_back(server_connection); |
112 } | 114 } |
113 | 115 |
114 void SMAcceptorThread::AcceptFromListenFD() { | 116 void SMAcceptorThread::AcceptFromListenFD() { |
115 if (acceptor_->accepts_per_wake_ > 0) { | 117 if (acceptor_->accepts_per_wake_ > 0) { |
116 for (int i = 0; i < acceptor_->accepts_per_wake_; ++i) { | 118 for (int i = 0; i < acceptor_->accepts_per_wake_; ++i) { |
117 struct sockaddr address; | 119 struct sockaddr address; |
118 socklen_t socklen = sizeof(address); | 120 socklen_t socklen = sizeof(address); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 203 } |
202 | 204 |
203 void SMAcceptorThread::SMConnectionDone(SMConnection* sc) { | 205 void SMAcceptorThread::SMConnectionDone(SMConnection* sc) { |
204 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Done with connection."; | 206 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Done with connection."; |
205 tmp_unused_server_connections_.push_back(sc); | 207 tmp_unused_server_connections_.push_back(sc); |
206 } | 208 } |
207 | 209 |
208 } // namespace net | 210 } // namespace net |
209 | 211 |
210 | 212 |
OLD | NEW |