Skip to content
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

Fix pipeThrough error and track API changes #752

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all 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
6 changes: 3 additions & 3 deletions webtransport/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function sendData() {
case 'bidi': {
let stream = await transport.createBidirectionalStream();
let number = streamNumber++;
readFromIncomingStream(stream, number);
readFromIncomingStream(stream.readable, number);

let writer = stream.writable.getWriter();
await writer.write(data);
Expand Down Expand Up @@ -129,9 +129,9 @@ async function acceptUnidirectionalStreams(transport) {
}
}

async function readFromIncomingStream(stream, number) {
async function readFromIncomingStream(readable, number) {
let decoder = new TextDecoderStream('utf-8');
aboba marked this conversation as resolved.
Show resolved Hide resolved
let reader = stream.pipeThrough(decoder).getReader();
let reader = readable.pipeThrough(decoder).getReader();
try {
while (true) {
const { value, done } = await reader.read();
Expand Down