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

Unified Diff: remoting/host/chromoting_host.cc

Issue 10409021: Handle disconnection events properly for unauthenicated clients. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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/client_session.h » ('j') | remoting/host/client_session.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index a1285544f05a6d4bdfc8004108a684e10209688b..0bcaf1f04c536536aec4c516d7964d98cf79fce3 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -250,19 +250,21 @@ void ChromotingHost::OnSessionClosed(ClientSession* client) {
CHECK(it != clients_.end());
clients_.erase(it);
- if (recorder_.get()) {
- recorder_->RemoveConnection(client->connection());
- }
+ if (client->is_authenticated()) {
+ if (recorder_.get()) {
+ recorder_->RemoveConnection(client->connection());
Wez 2012/05/18 20:20:57 nit: It should be safe to RemoveConnection() for a
Sergey Ulanov 2012/05/21 18:20:13 It doesn't make sense to remove the connection if
Wez 2012/05/21 20:33:50 True, but you're testing whether |recorder_| is se
Sergey Ulanov 2012/05/21 22:27:55 Done.
+ }
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientDisconnected(client->client_jid()));
+ FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
+ OnClientDisconnected(client->client_jid()));
Wez 2012/05/18 20:20:57 This changes the semantics of OnClientDisconnected
Sergey Ulanov 2012/05/21 18:20:13 Yes. I think for such clients the observers will s
- if (recorder_.get()) {
- // Currently we don't allow more than one simultaneous connection,
- // so we need to shutdown recorder when a client disconnects.
- StopScreenRecorder();
+ if (recorder_.get()) {
+ // Currently we don't allow more than one simultaneous connection,
+ // so we need to shutdown recorder when a client disconnects.
+ StopScreenRecorder();
+ }
+ desktop_environment_->OnSessionFinished();
}
- desktop_environment_->OnSessionFinished();
}
void ChromotingHost::OnSessionSequenceNumber(ClientSession* session,
« no previous file with comments | « no previous file | remoting/host/client_session.h » ('j') | remoting/host/client_session.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698