diff options
-rw-r--r-- | remoting/host/heartbeat_sender.cc | 8 | ||||
-rw-r--r-- | remoting/host/heartbeat_sender.h | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index e72c5a1..10fb3aa 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc @@ -46,6 +46,7 @@ void HeartbeatSender::DoStart() { DCHECK(MessageLoop::current() == jingle_client_->message_loop()); request_.reset(new IqRequest(jingle_client_)); + request_->set_callback(NewCallback(this, &HeartbeatSender::ProcessResponse)); jingle_client_->message_loop()->PostTask( FROM_HERE, NewRunnableMethod(this, &HeartbeatSender::DoSendStanza)); @@ -66,4 +67,11 @@ void HeartbeatSender::DoSendStanza() { kHeartbeatPeriodMs); } +void HeartbeatSender::ProcessResponse(const buzz::XmlElement* response) { + if (response->Attr(buzz::QN_TYPE) == buzz::STR_ERROR) { + LOG(ERROR) << "Received error in response to heartbeat: " + << response->Str(); + } +} + } // namespace remoting diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h index b072511..6521654 100644 --- a/remoting/host/heartbeat_sender.h +++ b/remoting/host/heartbeat_sender.h @@ -26,10 +26,11 @@ class HeartbeatSender : public base::RefCountedThreadSafe<HeartbeatSender> { void Start(JingleClient* jingle_client, const std::string& host_id); private: - void DoStart(); void DoSendStanza(); + void ProcessResponse(const buzz::XmlElement* response); + bool started_; JingleClient* jingle_client_; std::string host_id_; |