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