summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 05:46:28 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 05:46:28 +0000
commit4e60d8dc0b83405f123c3cdcd43928f444bb68d6 (patch)
treec1a90565f2968565af8f61f3f3ca4e3b5db46db3 /jingle
parent2cf74ec41fe31b14fe99f7e0c48c757a6587d8ea (diff)
downloadchromium_src-4e60d8dc0b83405f123c3cdcd43928f444bb68d6.zip
chromium_src-4e60d8dc0b83405f123c3cdcd43928f444bb68d6.tar.gz
chromium_src-4e60d8dc0b83405f123c3cdcd43928f444bb68d6.tar.bz2
[Sync] Treat XMPP auth errors as sync auth errors
Add controls for XMPP authentication to XMPP test server. Add integration test for XMPP auth errors. Add some DVLOGs to help debugging. BUG=38091 TEST= Review URL: https://chromiumcodereview.appspot.com/10703035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/notifier/communicator/login.cc11
-rw-r--r--jingle/notifier/communicator/single_login_attempt.cc3
-rw-r--r--jingle/notifier/listener/xmpp_push_client.cc2
3 files changed, 12 insertions, 4 deletions
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc
index afb0152..8350d2f 100644
--- a/jingle/notifier/communicator/login.cc
+++ b/jingle/notifier/communicator/login.cc
@@ -59,6 +59,7 @@ void Login::StartConnection() {
}
void Login::UpdateXmppSettings(const buzz::XmppClientSettings& user_settings) {
+ DVLOG(1) << "XMPP settings updated";
login_settings_.set_user_settings(user_settings);
}
@@ -68,11 +69,13 @@ void Login::UpdateXmppSettings(const buzz::XmppClientSettings& user_settings) {
// TODO(akalin): Add unit tests to enforce the behavior above.
void Login::OnConnect(base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
+ DVLOG(1) << "Connected";
ResetReconnectState();
delegate_->OnConnect(base_task);
}
void Login::OnRedirect(const ServerInformation& redirect_server) {
+ DVLOG(1) << "Redirected";
login_settings_.SetRedirectServer(redirect_server);
// Drop the current connection, and start the login process again.
StartConnection();
@@ -80,28 +83,30 @@ void Login::OnRedirect(const ServerInformation& redirect_server) {
}
void Login::OnCredentialsRejected() {
+ DVLOG(1) << "Credentials rejected";
TryReconnect();
delegate_->OnCredentialsRejected();
}
void Login::OnSettingsExhausted() {
+ DVLOG(1) << "Settings exhausted";
TryReconnect();
delegate_->OnTransientDisconnection();
}
void Login::OnIPAddressChanged() {
- DVLOG(1) << "Detected IP address change";
+ DVLOG(1) << "IP address changed";
OnNetworkEvent();
}
void Login::OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) {
- DVLOG(1) << "Detected connection type change";
+ DVLOG(1) << "Connection type changed";
OnNetworkEvent();
}
void Login::OnDNSChanged() {
- DVLOG(1) << "Detected DNS change";
+ DVLOG(1) << "DNS changed";
OnNetworkEvent();
}
diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc
index c2405fe..16d8d42 100644
--- a/jingle/notifier/communicator/single_login_attempt.cc
+++ b/jingle/notifier/communicator/single_login_attempt.cc
@@ -137,6 +137,7 @@ void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
}
if (error == buzz::XmppEngine::ERROR_UNAUTHORIZED) {
+ DVLOG(1) << "Credentials rejected";
delegate_->OnCredentialsRejected();
return;
}
@@ -148,7 +149,7 @@ void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
++current_settings_;
if (current_settings_ == settings_list_.end()) {
- VLOG(1) << "Could not connect to any XMPP server";
+ DVLOG(1) << "Could not connect to any XMPP server";
delegate_->OnSettingsExhausted();
return;
}
diff --git a/jingle/notifier/listener/xmpp_push_client.cc b/jingle/notifier/listener/xmpp_push_client.cc
index 76ee4ee..2227650 100644
--- a/jingle/notifier/listener/xmpp_push_client.cc
+++ b/jingle/notifier/listener/xmpp_push_client.cc
@@ -61,6 +61,7 @@ void XmppPushClient::OnConnect(
void XmppPushClient::OnTransientDisconnection() {
DCHECK(thread_checker_.CalledOnValidThread());
+ DVLOG(1) << "Push: Transient disconnection";
base_task_.reset();
FOR_EACH_OBSERVER(PushClientObserver, observers_,
OnNotificationsDisabled(TRANSIENT_NOTIFICATION_ERROR));
@@ -68,6 +69,7 @@ void XmppPushClient::OnTransientDisconnection() {
void XmppPushClient::OnCredentialsRejected() {
DCHECK(thread_checker_.CalledOnValidThread());
+ DVLOG(1) << "Push: Credentials rejected";
base_task_.reset();
FOR_EACH_OBSERVER(
PushClientObserver, observers_,