diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 21:07:29 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-03 21:07:29 +0000 |
commit | 3db8bb08078f239887acebad75af1e32f4c7d601 (patch) | |
tree | 4527af94935e56695227e0038ea699712255029c /remoting/jingle_glue | |
parent | 1ba39c0011aa0a09843d6d8b8c092839d45b87ed (diff) | |
download | chromium_src-3db8bb08078f239887acebad75af1e32f4c7d601.zip chromium_src-3db8bb08078f239887acebad75af1e32f4c7d601.tar.gz chromium_src-3db8bb08078f239887acebad75af1e32f4c7d601.tar.bz2 |
Return correct value from XmppSignalStrategy::HandleStanza()
BUG=91531
TEST=Connection always works.
Review URL: http://codereview.chromium.org/7564024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/jingle_glue')
-rw-r--r-- | remoting/jingle_glue/javascript_signal_strategy.cc | 5 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_signaling_connector.cc | 5 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_signaling_connector.h | 2 | ||||
-rw-r--r-- | remoting/jingle_glue/signal_strategy.h | 3 | ||||
-rw-r--r-- | remoting/jingle_glue/xmpp_signal_strategy.cc | 4 |
5 files changed, 12 insertions, 7 deletions
diff --git a/remoting/jingle_glue/javascript_signal_strategy.cc b/remoting/jingle_glue/javascript_signal_strategy.cc index 4e966b1..bb423d6 100644 --- a/remoting/jingle_glue/javascript_signal_strategy.cc +++ b/remoting/jingle_glue/javascript_signal_strategy.cc @@ -89,8 +89,9 @@ void JavascriptSignalStrategy::OnIq(const std::string& stanza_str) { return; } - if (listener_) - listener_->OnIncomingStanza(stanza.get()); + if (listener_ && listener_->OnIncomingStanza(stanza.get())) + return; + iq_registry_.OnIncomingStanza(stanza.get()); } diff --git a/remoting/jingle_glue/jingle_signaling_connector.cc b/remoting/jingle_glue/jingle_signaling_connector.cc index 729ce6d..cd60523 100644 --- a/remoting/jingle_glue/jingle_signaling_connector.cc +++ b/remoting/jingle_glue/jingle_signaling_connector.cc @@ -32,7 +32,7 @@ JingleSignalingConnector::~JingleSignalingConnector() { signal_strategy_->SetListener(NULL); } -void JingleSignalingConnector::OnIncomingStanza( +bool JingleSignalingConnector::OnIncomingStanza( const buzz::XmlElement* stanza) { // TODO(ajwong): Techncially, when SessionManager sends IQ packets, it // actually expects a response in SessionSendTask(). However, if you look in @@ -46,7 +46,10 @@ void JingleSignalingConnector::OnIncomingStanza( if (session_manager_->IsSessionMessage(stanza)) { session_manager_->OnIncomingMessage(stanza); + return true; } + + return false; } void JingleSignalingConnector::OnOutgoingMessage( diff --git a/remoting/jingle_glue/jingle_signaling_connector.h b/remoting/jingle_glue/jingle_signaling_connector.h index 2f783f5..d14e0e6 100644 --- a/remoting/jingle_glue/jingle_signaling_connector.h +++ b/remoting/jingle_glue/jingle_signaling_connector.h @@ -42,7 +42,7 @@ class JingleSignalingConnector : public SignalStrategy::Listener, virtual ~JingleSignalingConnector(); // SignalStrategy::Listener interface. - virtual void OnIncomingStanza(const buzz::XmlElement* stanza) OVERRIDE; + virtual bool OnIncomingStanza(const buzz::XmlElement* stanza) OVERRIDE; private: void OnResponse(const buzz::XmlElement* stanza); diff --git a/remoting/jingle_glue/signal_strategy.h b/remoting/jingle_glue/signal_strategy.h index 3d0a559..1f90d03 100644 --- a/remoting/jingle_glue/signal_strategy.h +++ b/remoting/jingle_glue/signal_strategy.h @@ -35,7 +35,8 @@ class SignalStrategy { class Listener { public: - virtual void OnIncomingStanza(const buzz::XmlElement* stanza) = 0; + // Must return true if the stanza was handled, false otherwise. + virtual bool OnIncomingStanza(const buzz::XmlElement* stanza) = 0; }; SignalStrategy() {} diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc index a5f9a2b..f1e399b 100644 --- a/remoting/jingle_glue/xmpp_signal_strategy.cc +++ b/remoting/jingle_glue/xmpp_signal_strategy.cc @@ -53,7 +53,7 @@ void XmppSignalStrategy::Init(StatusObserver* observer) { xmpp_client_->Connect(settings, "", socket, CreatePreXmppAuth(settings)); xmpp_client_->SignalStateChange.connect( this, &XmppSignalStrategy::OnConnectionStateChanged); - xmpp_client_->engine()->AddStanzaHandler(this, buzz::XmppEngine::HL_PEEK); + xmpp_client_->engine()->AddStanzaHandler(this, buzz::XmppEngine::HL_TYPE); xmpp_client_->Start(); } @@ -87,7 +87,7 @@ IqRequest* XmppSignalStrategy::CreateIqRequest() { bool XmppSignalStrategy::HandleStanza(const buzz::XmlElement* stanza) { if (listener_) - listener_->OnIncomingStanza(stanza); + return listener_->OnIncomingStanza(stanza); return false; } |