Skip to content

Commit

Permalink
Merge pull request #570 from jan-ivar/maynote
Browse files Browse the repository at this point in the history
Move normative prose in send algortithms out of notes.
  • Loading branch information
jan-ivar authored Nov 21, 2023
2 parents 7ffd402 + e60f0d1 commit 071e45d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1583,23 +1583,27 @@ To <dfn for="WebTransportSendStream">write</dfn> |chunk| to a {{WebTransportSend
This sending MAY be interleaved with sending of previously queued streams and datagrams,
as well as streams and datagrams yet to be queued to be sent over this transport.

The user-agent MAY have a buffer to improve the transfer performance. Such a buffer
SHOULD have a fixed upper limit, to carry the backpressure information to the user of the
{{WebTransportSendStream}}.

This sending MUST starve
until all bytes queued for sending on {{WebTransportSendStream}}s with the
same {{[[SendGroup]]}} and a higher {{[[SendOrder]]}}, that are neither
[=WritableStream/Error | errored=] nor blocked by [=flow control=], have been
sent.

We access |stream|.{{[[SendOrder]]}} [=in parallel=] here. User agents SHOULD
respond to live updates of these values during sending, though the details are
[=implementation-defined=].

This sending MUST NOT starve otherwise,
except for [=flow control=] reasons or [=WritableStream/Error | error=].

The user agent SHOULD divide bandwidth fairly between all streams that aren't starved.

Note: The definition of fairness here is [=implementation-defined=].

Note: We access |stream|.{{[[SendOrder]]}} [=in parallel=] here. User agents SHOULD
respond to live updates of these values during sending, though the details are
[=implementation-defined=].

1. If the previous step failed, abort the remaining steps.

Note: We don't reject |promise| here because we handle network errors elsewhere, and those steps
Expand All @@ -1610,9 +1614,7 @@ To <dfn for="WebTransportSendStream">write</dfn> |chunk| to a {{WebTransportSend
1. [=Resolve=] |promise| with undefined.
1. Return |promise|.

Note: The user-agent MAY have a buffer to improve the transfer performance. Such a buffer
SHOULD have a fixed upper limit, to carry the backpressure information to the user of
{{WebTransportSendStream}}. This also means the [=fulfilled|fulfillment=] of the promise returned from this algorithm (or,
Note: The [=fulfilled|fulfillment=] of the promise returned from this algorithm (or,
{{WritableStreamDefaultWriter/write|WritableStreamDefaultWriter.write}}) does **NOT** necessarily mean that the chunk is acked by
the server [[!QUIC]]. It may just mean that the chunk is appended to the buffer. To make sure that
the chunk arrives at the server, use an application-level protocol.
Expand Down Expand Up @@ -1909,7 +1911,8 @@ To <dfn for="WebTransportReceiveStream">pull bytes</dfn> from a {{WebTransportRe
|buffer| with offset |offset|, up to |maxBytes| bytes. Wait until either at least one byte is
read or FIN is received. Let |read| be the number of read bytes, and let |hasReceivedFIN| be
whether FIN was accompanied.
Note: The user-agent MAY have a buffer to improve the transfer performance. Such a buffer

The user-agent MAY have a buffer to improve the transfer performance. Such a buffer
SHOULD have a fixed upper limit, to carry the backpressure information to the server.

Note: This operation may return before filling up all of |bytes|.
Expand Down

0 comments on commit 071e45d

Please sign in to comment.