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 127f9bf6541566e9a9c020a6337abfe721ba4d2c..277b9b01a1900339ca42f18c5b4bc8f13ddbb486 100644 |
--- a/google_apis/gcm/engine/mcs_client.cc |
+++ b/google_apis/gcm/engine/mcs_client.cc |
@@ -536,6 +536,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; |
} |
@@ -586,7 +589,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); |
@@ -737,7 +741,8 @@ MCSClient::PersistentId MCSClient::GetNextPersistentId() { |
} |
void MCSClient::OnConnectionResetByHeartbeat() { |
- connection_factory_->SignalConnectionReset(); |
+ connection_factory_->SignalConnectionReset( |
+ ConnectionFactory::HEARTBEAT_FAILURE); |
} |
void MCSClient::NotifyMessageSendStatus( |