Index: talk/app/webrtc/webrtcsession.cc |
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc |
index ec0456f7cb9f1f8743dabc4794f181353369f439..be12c24ab2a09eba3ef1b4db958dea89bafc2662 100644 |
--- a/talk/app/webrtc/webrtcsession.cc |
+++ b/talk/app/webrtc/webrtcsession.cc |
@@ -492,9 +492,13 @@ class IceRestartAnswerLatch { |
} |
} |
+ // This method has two purposes: 1. Return whether |new_desc| requests |
+ // an ICE restart (i.e., new ufrag/pwd). 2. If it requests an ICE restart |
+ // and it is an OFFER, remember this in |ice_restart_| so that the next |
+ // Local Answer will be created with new ufrag and pwd. |
bool CheckForRemoteIceRestart(const SessionDescriptionInterface* old_desc, |
const SessionDescriptionInterface* new_desc) { |
- if (!old_desc || new_desc->type() != SessionDescriptionInterface::kOffer) { |
+ if (!old_desc) { |
return false; |
} |
const SessionDescription* new_sd = new_desc->description(); |
@@ -520,7 +524,9 @@ class IceRestartAnswerLatch { |
new_transport_desc->ice_ufrag, |
new_transport_desc->ice_pwd)) { |
LOG(LS_INFO) << "Remote peer request ice restart."; |
- ice_restart_ = true; |
+ if (new_desc->type() == SessionDescriptionInterface::kOffer) { |
+ ice_restart_ = true; |
+ } |
return true; |
} |
} |