Chromium Code Reviews| Index: remoting/protocol/jingle_session.cc |
| diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
| index 57a78fdb3ab466eb7b2c83011badec307c1111be..5a263682c95294daf0568871a9f2c26773ac2327 100644 |
| --- a/remoting/protocol/jingle_session.cc |
| +++ b/remoting/protocol/jingle_session.cc |
| @@ -343,12 +343,17 @@ 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; |
| + if (state_ == CLOSED || state_ == FAILED) { |
| + // Ignore all responses after session was closed. |
|
Wez
2014/08/20 01:45:23
nit: Suggest moving this comment outside the if()
Sergey Ulanov
2014/08/25 17:28:08
Done.
|
| + 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 +367,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); |
|
Wez
2014/08/20 01:45:23
Does this mean we can't ever return INCOMPATIBLE_P
Sergey Ulanov
2014/08/25 17:28:07
No, there are some placed where INCOMPATIBLE_PROTO
|
| - 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. |
|
Wez
2014/08/20 01:45:23
nit: Please file a bug for that work and add a lin
Sergey Ulanov
2014/08/25 17:28:08
This is not a new TODO. I don't think we need a bu
|
| + CloseInternal(PEER_IS_OFFLINE); |
| } |
| } |
| } |