Index: remoting/protocol/jingle_session.cc |
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
index 57a78fdb3ab466eb7b2c83011badec307c1111be..501e6afab304cba96ed2cbc529905d385bce22f1 100644 |
--- a/remoting/protocol/jingle_session.cc |
+++ b/remoting/protocol/jingle_session.cc |
@@ -343,12 +343,16 @@ void JingleSession::OnMessageResponse( |
JingleMessage::ActionType request_type, |
IqRequest* request, |
const buzz::XmlElement* response) { |
- std::string type_str = JingleMessage::GetActionName(request_type); |
- |
// Delete the request from the list of pending requests. |
pending_requests_.erase(request); |
delete request; |
+ // Ignore all responses after session was closed. |
+ if (state_ == CLOSED || state_ == FAILED) |
+ return; |
+ |
+ std::string type_str = JingleMessage::GetActionName(request_type); |
+ |
// |response| will be NULL if the request timed out. |
if (!response) { |
LOG(ERROR) << type_str << " request timed out."; |
@@ -362,18 +366,9 @@ void JingleSession::OnMessageResponse( |
<< " message: \"" << response->Str() |
<< "\". Terminating the session."; |
- switch (request_type) { |
- case JingleMessage::SESSION_INFO: |
- // session-info is used for the new authentication protocol, |
- // and wasn't previously supported. |
- CloseInternal(INCOMPATIBLE_PROTOCOL); |
- break; |
- |
- default: |
- // TODO(sergeyu): There may be different reasons for error |
- // here. Parse the response stanza to find failure reason. |
- CloseInternal(PEER_IS_OFFLINE); |
- } |
+ // TODO(sergeyu): There may be different reasons for error |
+ // here. Parse the response stanza to find failure reason. |
+ CloseInternal(PEER_IS_OFFLINE); |
} |
} |
} |