Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: remoting/host/gnubby_auth_handler_posix.cc

Issue 1234003002: Fix GnubbyAuthHandlerPosix to handle requests correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@allowIo
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/gnubby_auth_handler_posix.h ('k') | remoting/host/gnubby_auth_handler_posix_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/gnubby_auth_handler_posix.cc
diff --git a/remoting/host/gnubby_auth_handler_posix.cc b/remoting/host/gnubby_auth_handler_posix.cc
index f8a9f4e75ecb6b1e59437833a5f6b4719e3edc44..d61946821058a2226e9b70db9a00cc0dcc3d62f8 100644
--- a/remoting/host/gnubby_auth_handler_posix.cc
+++ b/remoting/host/gnubby_auth_handler_posix.cc
@@ -231,14 +231,9 @@ void GnubbyAuthHandlerPosix::OnReadComplete(int connection_id) {
return;
}
ProcessGnubbyRequest(connection_id, request_data);
- Close(iter);
-}
-
-void GnubbyAuthHandlerPosix::Close(const ActiveSockets::iterator& iter) {
- DCHECK(CalledOnValidThread());
-
- delete iter->second;
- active_sockets_.erase(iter);
+ iter->second->StartReadingRequest(
+ base::Bind(&GnubbyAuthHandlerPosix::OnReadComplete,
+ base::Unretained(this), connection_id));
}
void GnubbyAuthHandlerPosix::CreateAuthorizationSocket() {
@@ -284,7 +279,8 @@ GnubbyAuthHandlerPosix::GetSocketForMessage(base::DictionaryValue* message) {
void GnubbyAuthHandlerPosix::SendErrorAndCloseActiveSocket(
const ActiveSockets::iterator& iter) {
iter->second->SendSshError();
- Close(iter);
+ delete iter->second;
+ active_sockets_.erase(iter);
}
void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) {
« no previous file with comments | « remoting/host/gnubby_auth_handler_posix.h ('k') | remoting/host/gnubby_auth_handler_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698