Skip to content

Commit

Permalink
Check for invalid rollback
Browse files Browse the repository at this point in the history
Fix for Issue #1470
  • Loading branch information
aboba committed Jul 15, 2017
1 parent a12bf47 commit 34c8eee
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1294,12 +1294,20 @@ <h4>Set the RTCSessionSessionDescription</h4>
<li>
If <var>description</var> is set as a local description,
if <code><var>description</var>.type</code> is
<code>offer</code> and <code><var>description</var>.sdp</code>
<code>"offer"</code> and <code><var>description</var>.sdp</code>
is not equal to <var>connection</var>'s <a>[[\LastOffer]]</a> slot,
then reject <var>p</var> with a newly <a data-link-for="exception"
data-lt="create">created</a>
<code>InvalidModificationError</code> and abort these steps.
</li>
<li>
If <var>description</var> is set as a local description,
if <code><var>description</var>.type</code> is <code>"rollback"</code>
and <a>signaling state</a> is not <code>"have-local-offer"</code>
then reject <var>p</var> with a newly <a data-link-for="exception"
data-lt="create">created</a>
<code>InvalidStateError</code> and abort these steps.</p>
</li>
<li>
If <var>description</var> is set as a local description,
if <code><var>description</var>.type</code> is
Expand Down Expand Up @@ -1367,31 +1375,40 @@ <h4>Set the RTCSessionSessionDescription</h4>
and <code><a data-for=
"RTCPeerConnection">pendingLocalDescription</a></code>
to null. Finally set <var>connection</var>'s
<a>signaling state</a> to <code>stable</code></p>
<a>signaling state</a> to <code>"stable"</code></p>
</li>
<!-- B) transition rollback to haveLocalOffer to stable -->
<!-- B) transition rollback to haveLocalOffer to stable -->
<li>
<p>If <var>description</var> is of type "rollback",
<p>If <var>description</var> is of type <code>"rollback"</code>,
then this is a rollback. Set
<code><var>connection</var>.<a data-for=
"RTCPeerConnection">pendingLocalDescription</a></code>
to null and <a>signaling state</a> to
<code>stable</code>.</p>
<code>"stable"</code>.</p>
</li>
<!-- G) transition haveRemoteOffer to haveLocalProvAnswer -->
<li>
<p>If <var>description</var> is of type "pranswer",
<p>If <var>description</var> is of type <code>"pranswer"</code>,
then set <code><var>connection</var>.<a data-for=
"RTCPeerConnection">pendingLocalDescription</a></code>
to <var>description</var> and <a>signaling state</a> to
<code>have-local-pranswer</code>.</p>
<code>"have-local-pranswer"</code>.</p>
</li>
</ul>
</li>
<li>
<p>Otherwise, if <var>description</var> is set as a remote
description, then run one of the following steps:</p>
<ul>
<li>
If <var>description</var> is set as a remote description,
if <code><var>description</var>.type</code> is <code>"rollback"</code>
and <a>signaling state</a> is not <code>"have-remote-offer"</code>
or <code>"have-remote-pranswer"</code>
then reject <var>p</var> with a newly <a data-link-for="exception"
data-lt="create">created</a>
<code>InvalidStateError</code> and abort these steps.</p>
</li>
<!-- D) transition stable to haveRemoteOffer -->
<li>
<p>If <var>description</var> is of type "offer", set
Expand Down

0 comments on commit 34c8eee

Please sign in to comment.