summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 02:45:19 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 02:45:19 +0000
commitc5e5790703b510ee8d0e97684324e59a862e159f (patch)
tree12f0f2644d0da02d5bc608fe2c985f9a70b160c8 /remoting/host
parent9adbb9ec57ab86a6aa603cf0ef5f13b87578ffaa (diff)
downloadchromium_src-c5e5790703b510ee8d0e97684324e59a862e159f.zip
chromium_src-c5e5790703b510ee8d0e97684324e59a862e159f.tar.gz
chromium_src-c5e5790703b510ee8d0e97684324e59a862e159f.tar.bz2
Fix SignalingConnector to reset XMPP connection only when it's not connected.
Previously SignalingConnector would reset XMPP connection whenever IP address changes. This would cause the host to be disconnected unexpectedly when a new network interface is activated. Now the IP change handler will only reset XMPP connection when it is inactive. If XMPP connection is active then network change notifications must be ignored. In that case, if the change does affect the connection then we will get a separate notification when TCP stack drops it. BUG=166890 Review URL: https://codereview.chromium.org/12217093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/signaling_connector.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/remoting/host/signaling_connector.cc b/remoting/host/signaling_connector.cc
index eff6221..2112d65 100644
--- a/remoting/host/signaling_connector.cc
+++ b/remoting/host/signaling_connector.cc
@@ -94,7 +94,8 @@ bool SignalingConnector::OnSignalStrategyIncomingStanza(
void SignalingConnector::OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) {
DCHECK(CalledOnValidThread());
- if (type != net::NetworkChangeNotifier::CONNECTION_NONE) {
+ if (type != net::NetworkChangeNotifier::CONNECTION_NONE &&
+ signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) {
LOG(INFO) << "Network state changed to online.";
ResetAndTryReconnect();
}
@@ -102,8 +103,10 @@ void SignalingConnector::OnConnectionTypeChanged(
void SignalingConnector::OnIPAddressChanged() {
DCHECK(CalledOnValidThread());
- LOG(INFO) << "IP address has changed.";
- ResetAndTryReconnect();
+ if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) {
+ LOG(INFO) << "IP address has changed.";
+ ResetAndTryReconnect();
+ }
}
void SignalingConnector::OnGetTokensResponse(const std::string& user_email,