Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1510)

Unified Diff: remoting/protocol/jingle_session.cc

Issue 493573002: Fix JingleSession class to avoid bogus incompatible protocol error (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698