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

Unified Diff: remoting/host/daemon_process.cc

Issue 12544020: Remote RDP sessions, rather than the console, if curtain-mode is configured. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback. Created 7 years, 9 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 | « no previous file | remoting/host/daemon_process_win.cc » ('j') | remoting/host/desktop_session_win.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process.cc
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index 8c7cf67c7a6643dbc0d20e9d27d11f7d73fd8a29..1a601902c20453df9c41417d8e589740adcf5451 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -174,6 +174,9 @@ void DaemonProcess::CreateDesktopSession(int terminal_id,
bool virtual_terminal) {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
+ // Terminal IDs cannot be reused. Update the expected next terminal ID.
+ next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1);
+
// Validate the supplied terminal ID. An attempt to create a desktop session
// with an ID that could possibly have been allocated already is considered
// a protocol error and the network process will be restarted.
@@ -202,18 +205,15 @@ void DaemonProcess::CreateDesktopSession(int terminal_id,
// Create the desktop session.
scoped_ptr<DesktopSession> session = DoCreateDesktopSession(
terminal_id, params, virtual_terminal);
- if (session) {
- VLOG(1) << "Daemon: opened desktop session " << terminal_id;
- desktop_sessions_.push_back(session.release());
- } else {
+ if (!session) {
LOG(ERROR) << "Failed to create a desktop session.";
SendToNetwork(
new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id));
return;
}
- // Update the expected terminal ID.
- next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1);
+ VLOG(1) << "Daemon: opened desktop session " << terminal_id;
+ desktop_sessions_.push_back(session.release());
}
void DaemonProcess::CrashNetworkProcess(
« no previous file with comments | « no previous file | remoting/host/daemon_process_win.cc » ('j') | remoting/host/desktop_session_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698