GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: do not emit `end` on readable error · nodejs/node@ef992f6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams
    • readable.js
  • test/parallel
    • test-http2-client-destroy.js
    • test-http2-client-onconnect-errors.js
    • test-http2-compat-serverresponse-destroy.js
    • test-http2-empty-frame-without-eof.js
    • test-http2-max-concurrent-streams.js
    • test-http2-multi-content-length.js
    • test-http2-respond-file-fd-invalid.js
    • test-http2-respond-nghttperrors.js
    • test-http2-respond-with-fd-errors.js
    • test-http2-server-shutdown-before-respond.js
    • test-http2-server-socket-destroy.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/streams/readable.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/readable.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ function endReadableNT(state, stream) {
13281328
debug('endReadableNT', state.endEmitted, state.length);
13291329

13301330
// Check that we didn't get one last unshift.
1331-
if (!state.errorEmitted && !state.closeEmitted &&
1331+
if (!state.errored && !state.closeEmitted &&
13321332
!state.endEmitted && state.length === 0) {
13331333
state.endEmitted = true;
13341334
stream.emit('end');
Collapse file

‎test/parallel/test-http2-client-destroy.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-client-destroy.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const { getEventListeners } = require('events');
163163

164164
client.close();
165165
req.resume();
166-
req.on('end', common.mustCall());
166+
req.on('end', common.mustNotCall());
167167
req.on('close', common.mustCall(() => server.close()));
168168
}));
169169
}
Collapse file

‎test/parallel/test-http2-client-onconnect-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-client-onconnect-errors.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function runTest(test) {
102102
});
103103
}
104104

105-
req.on('end', common.mustCall());
105+
req.on('end', common.mustNotCall());
106106
req.on('close', common.mustCall(() => {
107107
client.destroy();
108108

Collapse file

‎test/parallel/test-http2-compat-serverresponse-destroy.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-compat-serverresponse-destroy.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ server.listen(0, common.mustCall(() => {
6262
req.on('close', common.mustCall(() => countdown.dec()));
6363

6464
req.resume();
65-
req.on('end', common.mustCall());
65+
req.on('end', common.mustNotCall());
6666
}
6767

6868
{
@@ -77,6 +77,6 @@ server.listen(0, common.mustCall(() => {
7777
req.on('close', common.mustCall(() => countdown.dec()));
7878

7979
req.resume();
80-
req.on('end', common.mustCall());
80+
req.on('end', common.mustNotCall());
8181
}
8282
}));
Collapse file

‎test/parallel/test-http2-empty-frame-without-eof.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-empty-frame-without-eof.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ async function main() {
3434
client.on('error', common.expectsError(expected));
3535
}
3636
stream.resume();
37-
await once(stream, 'end');
37+
await new Promise((resolve) => {
38+
stream.once('close', resolve);
39+
});
3840
client.close();
3941
}
4042
server.close();
Collapse file

‎test/parallel/test-http2-max-concurrent-streams.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-max-concurrent-streams.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ server.listen(0, common.mustCall(() => {
4545
req.on('aborted', common.mustCall());
4646
req.on('response', common.mustNotCall());
4747
req.resume();
48-
req.on('end', common.mustCall());
48+
req.on('end', common.mustNotCall());
4949
req.on('close', common.mustCall(() => countdown.dec()));
5050
req.on('error', common.expectsError({
5151
code: 'ERR_HTTP2_STREAM_ERROR',
Collapse file

‎test/parallel/test-http2-multi-content-length.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-multi-content-length.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ server.listen(0, common.mustCall(() => {
5454
// header to be set for non-payload bearing requests...
5555
const req = client.request({ 'content-length': 1 });
5656
req.resume();
57-
req.on('end', common.mustCall());
57+
req.on('end', common.mustNotCall());
5858
req.on('close', common.mustCall(() => countdown.dec()));
5959
req.on('error', common.expectsError({
6060
code: 'ERR_HTTP2_STREAM_ERROR',
Collapse file

‎test/parallel/test-http2-respond-file-fd-invalid.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-respond-file-fd-invalid.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ server.listen(0, () => {
4040
req.on('response', common.mustCall());
4141
req.on('error', errorCheck);
4242
req.on('data', common.mustNotCall());
43-
req.on('end', common.mustCall(() => {
43+
req.on('end', common.mustNotCall());
44+
req.on('close', common.mustCall(() => {
4445
assert.strictEqual(req.rstCode, NGHTTP2_INTERNAL_ERROR);
4546
client.close();
4647
server.close();
Collapse file

‎test/parallel/test-http2-respond-nghttperrors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-respond-nghttperrors.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ function runTest(test) {
8383
name: 'Error',
8484
message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR'
8585
}));
86+
req.on('end', common.mustNotCall());
8687

8788
currentError = test;
8889
req.resume();
8990
req.end();
9091

91-
req.on('end', common.mustCall(() => {
92+
req.on('close', common.mustCall(() => {
9293
client.close();
9394

9495
if (!tests.length) {
Collapse file

‎test/parallel/test-http2-respond-with-fd-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-respond-with-fd-errors.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ function runTest(test) {
9191
name: 'Error',
9292
message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR'
9393
}));
94+
req.on('end', common.mustNotCall());
9495

9596
currentError = test;
9697
req.resume();
9798
req.end();
9899

99-
req.on('end', common.mustCall(() => {
100+
req.on('close', common.mustCall(() => {
100101
client.close();
101102

102103
if (!tests.length) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.