File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -7234,15 +7234,21 @@ function makeUDPSocketStream(host, port) {
7234
7234
if (controller.byobRequest) {
7235
7235
const v = controller.byobRequest.view;
7236
7236
bytesRead = socket.readInto(v.buffer, v.byteOffset, v.byteLength);
7237
+ if (bytesRead === 0) {
7238
+ controller.close();
7239
+ }
7237
7240
controller.byobRequest.respond(bytesRead);
7238
7241
} else {
7239
7242
const buffer = new ArrayBuffer(DEFAULT_CHUNK_SIZE);
7240
7243
bytesRead = socket.readInto(buffer, 0, DEFAULT_CHUNK_SIZE);
7241
- controller.enqueue(new Uint8Array(buffer, 0, bytesRead));
7244
+ if (bytesRead === 0) {
7245
+ controller.close();
7246
+ } else {
7247
+ controller.enqueue(new Uint8Array(buffer, 0, bytesRead));
7248
+ }
7242
7249
}
7243
7250
7244
7251
if (bytesRead === 0) {
7245
- controller.close();
7246
7252
return;
7247
7253
}
7248
7254
@@ -7336,6 +7342,7 @@ function makeReadableByteFileStream(filename) {
7336
7342
if (bytesRead === 0) {
7337
7343
await fileHandle.close();
7338
7344
controller.close();
7345
+ controller.byobRequest.respond(0);
7339
7346
} else {
7340
7347
position += bytesRead;
7341
7348
controller.byobRequest.respond(bytesRead);
You can’t perform that action at this time.
0 commit comments