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 "remoting/host/gnubby_auth_handler_posix.h" | 5 #include "remoting/host/gnubby_auth_handler_posix.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 DCHECK(CalledOnValidThread()); | 202 DCHECK(CalledOnValidThread()); |
203 DCHECK_NE(net::ERR_IO_PENDING, result); | 203 DCHECK_NE(net::ERR_IO_PENDING, result); |
204 | 204 |
205 if (result < 0) { | 205 if (result < 0) { |
206 LOG(ERROR) << "Error in accepting a new connection"; | 206 LOG(ERROR) << "Error in accepting a new connection"; |
207 return; | 207 return; |
208 } | 208 } |
209 | 209 |
210 int connection_id = ++last_connection_id_; | 210 int connection_id = ++last_connection_id_; |
211 GnubbySocket* socket = | 211 GnubbySocket* socket = |
212 new GnubbySocket(accept_socket_.Pass(), request_timeout_, | 212 new GnubbySocket(std::move(accept_socket_), request_timeout_, |
213 base::Bind(&GnubbyAuthHandlerPosix::RequestTimedOut, | 213 base::Bind(&GnubbyAuthHandlerPosix::RequestTimedOut, |
214 base::Unretained(this), connection_id)); | 214 base::Unretained(this), connection_id)); |
215 active_sockets_[connection_id] = socket; | 215 active_sockets_[connection_id] = socket; |
216 socket->StartReadingRequest( | 216 socket->StartReadingRequest( |
217 base::Bind(&GnubbyAuthHandlerPosix::OnReadComplete, | 217 base::Bind(&GnubbyAuthHandlerPosix::OnReadComplete, |
218 base::Unretained(this), connection_id)); | 218 base::Unretained(this), connection_id)); |
219 | 219 |
220 // Continue accepting new connections. | 220 // Continue accepting new connections. |
221 DoAccept(); | 221 DoAccept(); |
222 } | 222 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 292 } |
293 | 293 |
294 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) { | 294 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) { |
295 HOST_LOG << "Gnubby request timed out"; | 295 HOST_LOG << "Gnubby request timed out"; |
296 ActiveSockets::iterator iter = active_sockets_.find(connection_id); | 296 ActiveSockets::iterator iter = active_sockets_.find(connection_id); |
297 if (iter != active_sockets_.end()) | 297 if (iter != active_sockets_.end()) |
298 SendErrorAndCloseActiveSocket(iter); | 298 SendErrorAndCloseActiveSocket(iter); |
299 } | 299 } |
300 | 300 |
301 } // namespace remoting | 301 } // namespace remoting |
OLD | NEW |