Index: google_apis/gcm/engine/mcs_client.cc |
diff --git a/google_apis/gcm/engine/mcs_client.cc b/google_apis/gcm/engine/mcs_client.cc |
index 0a0bfc92731d919fb3190cb2a7c04262673b426b..0044dcb302af0e45015e704b1fa9e69196a8b69a 100644 |
--- a/google_apis/gcm/engine/mcs_client.cc |
+++ b/google_apis/gcm/engine/mcs_client.cc |
@@ -532,6 +532,9 @@ void MCSClient::HandlePacketFromWire( |
state_ = UNINITIALIZED; |
DVLOG(1) << " Error code: " << login_response->error().code(); |
DVLOG(1) << " Error message: " << login_response->error().message(); |
+ LOG(ERROR) << "Failed to log in to GCM, resetting connection."; |
+ connection_factory_->SignalConnectionReset( |
+ ConnectionFactory::LOGIN_FAILURE); |
mcs_error_callback_.Run(); |
return; |
} |
@@ -582,7 +585,8 @@ void MCSClient::HandlePacketFromWire( |
case kCloseTag: |
LOG(ERROR) << "Received close command, resetting connection."; |
state_ = LOADED; |
- connection_factory_->SignalConnectionReset(); |
+ connection_factory_->SignalConnectionReset( |
+ ConnectionFactory::CLOSE_COMMAND); |
return; |
case kIqStanzaTag: { |
DCHECK_GE(stream_id_in_, 1U); |
@@ -733,7 +737,8 @@ MCSClient::PersistentId MCSClient::GetNextPersistentId() { |
} |
void MCSClient::OnConnectionResetByHeartbeat() { |
- connection_factory_->SignalConnectionReset(); |
+ connection_factory_->SignalConnectionReset( |
+ ConnectionFactory::HEARTBEAT_FAILURE); |
} |
void MCSClient::NotifyMessageSendStatus( |