Skip to content

Add a limited size buffer for streaming upload in HTTP request. #1204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 20, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5063,21 +5063,20 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:

<li>
<p>If <var>request</var>'s <a for=request>body</a> is non-null, and <var>request</var>'s
<a for=request>body</a>'s <a for=body>source</a> is null, the user agent may have a buffer up
to 64 kibibytes and store a part of <var>request</var>'s <a for=request>body</a> to the buffer.
If the user agent reads from <var>request</var>'s <a for=request>body</a> beyond the buffer
size and the user agent is required to resend <var>request</var>, return a
<a>network error</a>.
<a for=request>body</a>'s <a for=body>source</a> is null, then the user agent may have a
buffer up to 64 kibibytes and store a part of <var>request</var>'s <a for=request>body</a> in
the buffer. If the user agent reads from <var>request</var>'s <a for=request>body</a> beyond
the buffer size, then <var>request</var> is no longer eligible for resending.

<div class="note no-backref">
<div class=note>
<p>The resending is needed when the connection is timed out, for example.

<p>The buffer is not needed when <var>request</var>'s <a for=request>body</a>'s
<a for=body>source</a> is non-null, because the <a for=request>body</a> can be recreated
from it.
<a for=body>source</a> is non-null, because <var>request</var>'s <a for=request>body</a> can
be recreated from it.

<p>When <var>request</var>'s <a for=request>body</a>'s <a for=body>source</a> is null, it
means <a for=request>body</a> is created from {{ReadableStream}}, which means
means <a for=request>body</a> is created from a {{ReadableStream}} object, which means
<a for=request>body</a> cannot be recreated and that is why the buffer is needed.
</div>

Expand Down