Closed Bug 1091290 Opened 8 years ago Closed 8 years ago

addIceCandidate calls queued incorrectly (already-queued callbacks may never get called)

Categories

(Core :: WebRTC, defect)

32 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jib, Assigned: jib)

References

Details

Attachments

(1 file)

Observed by code-inspection.

addIceCandidate is queued incorrectly compared to other methods, storing off onSuccess/onFailure callbacks before the queue rather than after.

This overwrites the callbacks of any addIceCandidate call already on the queue.

STR in theory:

- Call createOffer immediately followed by two addIceCandidate calls, i.e.
  don't wait for createOffer successCallback before making the two calls.

Expected result:
- All three calls should succeed (or fail if something was wrong with them).

Actual result:
- You should see createOffer and the second addIceCandidate succeed (or fail),
  but the first addIceCandidate will never end.
Attachment #8513890 - Flags: review?(docfaraday)
Comment on attachment 8513890 [details] [diff] [review]
queue addIceCandidate correctly to not overwrite already-queued callbacks.

Review of attachment 8513890 [details] [diff] [review]:
-----------------------------------------------------------------

I think this will only cause problems if you make multiple addIceCandidate calls with different callbacks (including absent callbacks, potentially), but yeah that is a bug. Pretty sure this patch fixes that problem, since we end up adding the candidate and firing the callback (ie; calling callCB(_onAddIceCandidateSuccess/Failure)) synchronously.
Attachment #8513890 - Flags: review?(docfaraday) → review+
Hi, could you provide a try link? Thanks!
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/aa148a97a974
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.