Skip to content
Merged
Show file tree
Hide file tree
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: 4 additions & 2 deletions .github/workflows/notify-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
notifyOnForcePush:
name: Notify on Force Push on `main`
if: github.repository == 'nodejs/node' && github.event.forced
runs-on: ubuntu-slim
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
Expand All @@ -30,7 +31,8 @@ jobs:
validateCommitMessage:
name: Notify on Push on `main` with invalid message
if: github.repository == 'nodejs/node'
runs-on: ubuntu-slim
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
10 changes: 8 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,10 +1280,16 @@ def try_check_compiler(cc, lang):
b'__clang_major__ __clang_minor__ __clang_patchlevel__ '
b'__APPLE__')

cc_out = proc.communicate()
cc_stdout = to_utf8(cc_out[0])
if sys.platform == 'zos':
values = (to_utf8(proc.communicate()[0]).split('\n')[-2].split() + ['0'] * 7)[0:8]
values = (cc_stdout.split('\n')[-2].split() + ['0'] * 7)[0:8]
else:
values = (to_utf8(proc.communicate()[0]).split() + ['0'] * 7)[0:8]
values = (cc_stdout.split() + ['0'] * 7)[0:8]

if len(values) < 8:
cc_stderr = to_utf8(cc_out[1]) if cc_out[1] else ''
raise Exception(f'Could not determine compiler version info. \nstdout:\n{cc_stdout}\nstderr:\n{cc_stderr}')

is_clang = values[0] == '1'
gcc_version = tuple(map(int, values[1:1+3]))
Expand Down
6 changes: 3 additions & 3 deletions deps/amaro/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/amaro/dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"강동윤 <kdy1997.dev@gmail.com>"
],
"description": "wasm module for swc",
"version": "1.14.0",
"version": "1.15.11",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion deps/amaro/dist/strip-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function load(url, context, nextLoad) {
try {
const { source } = await nextLoad(url, {
...context,
format: "module"
format
});
const { code } = transformSync(source.toString(), {
mode: "strip-only",
Expand Down
2 changes: 1 addition & 1 deletion deps/amaro/dist/transform-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function load(url, context, nextLoad) {
try {
const { source } = await nextLoad(url, {
...context,
format: "module"
format
});
const { code, map } = transformSync(source.toString(), {
mode: "transform",
Expand Down
2 changes: 1 addition & 1 deletion deps/amaro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amaro",
"version": "1.1.6",
"version": "1.1.7",
"description": "Node.js TypeScript wrapper",
"license": "MIT",
"type": "commonjs",
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2680,6 +2680,8 @@ function processRespondWithFD(self, fd, headers, offset = 0, length = -1,
try {
headersList = buildNgHeaderString(headers, assertValidPseudoHeaderResponse);
} catch (err) {
if (self.ownsFd)
tryClose(fd);
self.destroy(err);
return;
}
Expand All @@ -2693,6 +2695,8 @@ function processRespondWithFD(self, fd, headers, offset = 0, length = -1,
const ret = self[kHandle].respond(headersList, streamOptions);

if (ret < 0) {
if (self.ownsFd)
tryClose(fd);
self.destroy(new NghttpError(ret));
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/amaro_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-amaro.sh
#ifndef SRC_AMARO_VERSION_H_
#define SRC_AMARO_VERSION_H_
#define AMARO_VERSION "1.1.6"
#define AMARO_VERSION "1.1.7"
#endif // SRC_AMARO_VERSION_H_
51 changes: 51 additions & 0 deletions test/parallel/test-http2-respond-file-fd-leak.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const fixtures = require('../common/fixtures');
const assert = require('assert');
const http2 = require('http2');
const fs = require('fs');

const fname = fixtures.path('elipses.txt');

const server = http2.createServer();

server.on('stream', common.mustCall((stream) => {
const originalClose = fs.close;
let fdClosed = false;

fs.close = common.mustCall(function(fd, cb) {
fdClosed = true;
return originalClose.apply(this, arguments);
});

const headers = {
':method': 'GET',
'content-type': 'text/plain'
};

stream.respondWithFile(fname, headers);

stream.on('error', common.mustCall((err) => {
assert.strictEqual(err.code, 'ERR_HTTP2_INVALID_PSEUDOHEADER');
}));

stream.on('close', common.mustCall(() => {
fs.close = originalClose;
assert.strictEqual(fdClosed, true);
}));
}));

server.listen(0, common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);
const req = client.request();

req.on('close', common.mustCall(() => {
client.close();
server.close();
}));

req.on('error', common.mustCall());
req.end();
}));
Loading