Skip to content

Commit

Permalink
Use "read a chunk" operation correctly
Browse files Browse the repository at this point in the history
The operation takes a reader but we passed a stream. This change fixes that.

Fixes #570.
  • Loading branch information
yutakahirano authored and annevk committed Aug 2, 2017
1 parent 194c2a1 commit c5a1394
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,14 @@ or "<code>worker</code>".
<li><p>If <var>body</var> is null, then <a>queue a fetch task</a> on <var>request</var> to
<a>process request end-of-body</a> for <var>request</var> and abort these steps.

<li>
<p>Let <var>reader</var> be the result of <a lt="get a reader" for=ReadableStream>getting
a reader</a> from <var>body</var>'s <a for=body>stream</a>.

<p class="note no-backref">This operation cannot throw an exception.

<li><p>Let <var>read</var> be the result of <a lt="read a chunk" for=ReadableStream>reading a
chunk</a> from <var>body</var>'s <a for=body>stream</a>.
chunk</a> from <var>body</var>'s <a for=body>stream</a> with <var>reader</var>.

<li>
<p><a>In parallel</a>, while true:
Expand All @@ -1205,7 +1211,7 @@ or "<code>worker</code>".
<p class="note no-backref">This step blocks until <var>bs</var> is fully transmitted.

<li><p>Set <var>read</var> to the result of <a lt="read a chunk" for=ReadableStream>reading a
chunk</a> from <var>body</var>'s <a for=body>stream</a>.
chunk</a> from <var>body</var>'s <a for=body>stream</a> with <var>reader</var>.
</ol>

<li><p>Otherwise, if <var>read</var> is fulfilled with an object whose <code>done</code> property
Expand Down

0 comments on commit c5a1394

Please sign in to comment.