Bug 1822038: Handle WebTransport Bidirectional streams arriving before the first pull r=kershaw

Differential Revision: https://phabricator.services.mozilla.com/D172414
This commit is contained in:
Randell Jesup 2023-03-22 02:21:50 +00:00
parent 9b09790eb5
commit 9f3c39c66f

View File

@ -53,7 +53,10 @@ WebTransportIncomingStreamsAlgorithms::PullCallbackImpl(
RefPtr<WebTransportIncomingStreamsAlgorithms> self(this);
// The real work of PullCallback()
// Step 5: Wait until there is an available incoming unidirectional stream.
if (mTransport->mUnidirectionalStreams.Length() == 0) {
auto length = (mUnidirectional == StreamType::Unidirectional)
? mTransport->mUnidirectionalStreams.Length()
: mTransport->mBidirectionalStreams.Length();
if (length == 0) {
// We need to wait.
// Per
// https://streams.spec.whatwg.org/#readablestreamdefaultcontroller-pulling