Re: [whatwg/fetch] Add a limited size buffer for streaming upload in HTTP request. (#1204)

@annevk commented on this pull request.



> @@ -5061,6 +5061,26 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
     <ul>
      <li><p>Follow the relevant requirements from HTTP. [[!HTTP]] [[!HTTP-SEMANTICS]] [[!HTTP-COND]] [[!HTTP-CACHING]] [[!HTTP-AUTH]]
 
+     <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 of
+      <a>implementation-defined</a> size and store a part of <var>request</var>'s
+      <a for=request>body</a> to the buffer. The buffer is used to resend <var>request</var>'s
+      <a for=request>body</a> to the network. If the user agent sent more than the buffer size and
+      is required to resend, return a <a>network error</a>.

I think it could be slightly clearer that this buffer doesn't contain the entire body and that if the user agent reads from the stream beyond the buffer size, the request is no longer eligible for resending. Rather than saying it's about what was sent as that doesn't matter as much.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1204#pullrequestreview-634481383

Received on Tuesday, 13 April 2021 11:35:44 UTC