diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-17 22:30:54 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-17 22:30:54 +0000 |
commit | ac31b78b597398068972d7858ec69fa1efb87621 (patch) | |
tree | 2fbd1b70dddeea64695b1e8329a58949d3910c94 /remoting/host/heartbeat_sender.cc | |
parent | 00270a9dcafa351e1465c92b1fce30d9639f03cc (diff) | |
download | chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.zip chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.tar.gz chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.tar.bz2 |
Chromoting: stopping the service if a permanent error is encountered (such as the host ID is permanently not recognized by the could or invalid host configuration).
BUG=123715,112160
Review URL: http://codereview.chromium.org/10106013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/heartbeat_sender.cc')
-rw-r--r-- | remoting/host/heartbeat_sender.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index e061acc..8420acf 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc @@ -13,6 +13,7 @@ #include "base/string_number_conversions.h" #include "base/time.h" #include "remoting/base/constants.h" +#include "remoting/host/constants.h" #include "remoting/jingle_glue/iq_sender.h" #include "remoting/jingle_glue/jingle_thread.h" #include "remoting/jingle_glue/signal_strategy.h" @@ -43,15 +44,15 @@ const int64 kResendDelayMs = 10 * 1000; // 10 seconds. const int64 kResendDelayOnHostNotFoundMs = 10 * 1000; // 10 seconds. const int kMaxResendOnHostNotFoundCount = 12; // 2 minutes (12 x 10 seconds). -const int kExitCodeHostIdInvalid = 100; - } // namespace HeartbeatSender::HeartbeatSender( + Listener* listener, const std::string& host_id, SignalStrategy* signal_strategy, HostKeyPair* key_pair) - : host_id_(host_id), + : listener_(listener), + host_id_(host_id), signal_strategy_(signal_strategy), key_pair_(key_pair), interval_ms_(kDefaultHeartbeatIntervalMs), @@ -134,11 +135,8 @@ void HeartbeatSender::ProcessResponse(IqRequest* request, &HeartbeatSender::ResendStanza); return; } - // TODO(lambroslambrou): Trigger an application-defined callback to - // shut down the host properly, instead of just exiting here - // (http://crbug.com/112160). - LOG(ERROR) << "Exit: Host ID not found"; - exit(kExitCodeHostIdInvalid); + listener_->OnUnknownHostIdError(); + return; } } |