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

Unified Diff: remoting/signaling/xmpp_signal_strategy.cc

Issue 1258323003: Fix XmppSignalStrategy to return correct result from SendStanza(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_config
Patch Set: 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/signaling/signal_strategy.h ('k') | remoting/signaling/xmpp_signal_strategy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/xmpp_signal_strategy.cc
diff --git a/remoting/signaling/xmpp_signal_strategy.cc b/remoting/signaling/xmpp_signal_strategy.cc
index 51eae4bc62c75ac11de54e5c55b3309ec8d11867..5edbb377f5b69a30ac947e436623f1971152dad8 100644
--- a/remoting/signaling/xmpp_signal_strategy.cc
+++ b/remoting/signaling/xmpp_signal_strategy.cc
@@ -191,6 +191,7 @@ void XmppSignalStrategy::Core::Disconnect() {
writer_.reset();
socket_.reset();
tls_state_ = TlsState::NOT_REQUESTED;
+ read_pending_ = false;
FOR_EACH_OBSERVER(Listener, listeners_,
OnSignalStrategyStateChange(DISCONNECTED));
@@ -234,13 +235,15 @@ bool XmppSignalStrategy::Core::SendStanza(scoped_ptr<buzz::XmlElement> stanza) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!stream_parser_) {
- VLOG(0) << "Dropping signalling message because XMPP "
- "connection has been terminated.";
+ VLOG(0) << "Dropping signalling message because XMPP is not connected.";
return false;
}
SendMessage(stanza->Str());
- return true;
+
+ // Return false if the SendMessage() call above resulted in the SignalStrategy
+ // being disconnected.
+ return stream_parser_ != nullptr;
}
void XmppSignalStrategy::Core::SetAuthInfo(const std::string& username,
« no previous file with comments | « remoting/signaling/signal_strategy.h ('k') | remoting/signaling/xmpp_signal_strategy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698