diff --git a/CHANGELOG.md b/CHANGELOG.md index 77e1b9113a7673..2d7dd9e55c3fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,8 @@ release. </tr> <tr> <td valign="top"> -<b><a href="doc/changelogs/CHANGELOG_V6.md#6.17.0">6.17.0</a></b><br/> +<b><a href="doc/changelogs/CHANGELOG_V6.md#6.17.1">6.17.1</a></b><br/> +<a href="doc/changelogs/CHANGELOG_V6.md#6.17.0">6.17.0</a><br/> <a href="doc/changelogs/CHANGELOG_V6.md#6.16.0">6.16.0</a><br/> <a href="doc/changelogs/CHANGELOG_V6.md#6.15.1">6.15.1</a><br/> <a href="doc/changelogs/CHANGELOG_V6.md#6.15.0">6.15.0</a><br/> diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5a935352a1f9f0..4c211405596cb4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,4 @@ # Code of Conduct -The Node.js Code of Conduct document has moved to -https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md. Please update -links to this document accordingly. - -The Node.js Moderation policy can be found at -https://github.com/nodejs/admin/blob/master/Moderation-Policy.md +* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) +* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/master/Moderation-Policy.md) diff --git a/Makefile b/Makefile index 523a3d8c541ed8..eedbf758e72167 100644 --- a/Makefile +++ b/Makefile @@ -574,8 +574,7 @@ PKG=$(TARNAME).pkg MACOSOUTDIR=out/macos release-only: - @if [ "$(DISTTYPE)" != "nightly" ] && [ "$(DISTTYPE)" != "next-nightly" ] && \ - `grep -q REPLACEME doc/api/*.md`; then \ + @if [ "$(DISTTYPE)" = "release" ] && `grep -q REPLACEME doc/api/*.md`; then \ echo 'Please update REPLACEME in Added: tags in doc/api/*.md (See doc/releases.md)' ; \ exit 1 ; \ fi diff --git a/common.gypi b/common.gypi index a0c00fee528fe5..9dcaa050b08dbe 100644 --- a/common.gypi +++ b/common.gypi @@ -84,6 +84,19 @@ ['OS=="aix"', { 'cflags': [ '-gxcoff' ], 'ldflags': [ '-Wl,-bbigtoc' ], + 'conditions': [ + ['target_arch=="ppc64"', { + 'ldflags': [ + '-Wl,-blibpath:/usr/lib:/lib:' + '/opt/freeware/lib/pthread/ppc64' + ], + }], + ['target_arch=="ppc"', { + 'ldflags': [ + '-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/pthread' + ], + }], + ], }], ['OS == "android"', { 'cflags': [ '-fPIE' ], @@ -332,11 +345,18 @@ [ 'OS=="aix"', { 'conditions': [ [ 'target_arch=="ppc"', { - 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], + 'ldflags': [ + '-Wl,-bmaxdata:0x60000000/dsa', + '-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/pthread', + ], }], [ 'target_arch=="ppc64"', { 'cflags': [ '-maix64' ], - 'ldflags': [ '-maix64' ], + 'ldflags': [ + '-maix64', + '-Wl,-blibpath:/usr/lib:/lib:' + '/opt/freeware/lib/pthread/ppc64', + ], }], ], 'ldflags': [ '-Wl,-bbigtoc' ], diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 93a1d186e7c620..6553c4a0323ced 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -95,6 +95,24 @@ Tells the kernel to join a multicast group at the given `multicastAddress` and one interface and will add membership to it. To add membership to every available interface, call `addMembership` multiple times, once per interface. +When sharing a UDP socket across multiple `cluster` workers, the +`socket.addMembership()` function must be called only once or an +`EADDRINUSE` error will occur: + +```js +const cluster = require('cluster'); +const dgram = require('dgram'); +if (cluster.isMaster) { + cluster.fork(); // Works ok. + cluster.fork(); // Fails with EADDRINUSE. +} else { + const s = dgram.createSocket('udp4'); + s.bind(1234, () => { + s.addMembership('224.0.0.114'); + }); +} +``` + ### socket.address() <!-- YAML added: v0.1.99 diff --git a/doc/changelogs/CHANGELOG_V6.md b/doc/changelogs/CHANGELOG_V6.md index b06ca752a85fcc..6cfd77e1a76c00 100644 --- a/doc/changelogs/CHANGELOG_V6.md +++ b/doc/changelogs/CHANGELOG_V6.md @@ -7,6 +7,7 @@ </tr> <tr> <td valign="top"> +<a href="#6.17.1">6.17.1</a><br/> <a href="#6.17.0">6.17.0</a><br/> <a href="#6.16.0">6.16.0</a><br/> <a href="#6.15.1">6.15.1</a><br/> @@ -69,6 +70,26 @@ [Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and will be supported actively until April 2018 and maintained until April 2019. +<a id="6.17.1"></a> +## 2019-04-03, Version 6.17.1 'Boron' (LTS), @BethGriggs + +Node 6 is due to go End-of-Life on 2019-04-30. + +### Notable Changes + +* **http**: + - fix error check in `Execute()` (Brian White) [#25939](https://github.com/nodejs/node/pull/25939) + +### Commits + +* [[`c9d21a0c10`](https://github.com/nodejs/node/commit/c9d21a0c10)] - **build**: set `-blibpath:` for AIX (Richard Lau) [#25447](https://github.com/nodejs/node/pull/25447) +* [[`9ba5fd6bad`](https://github.com/nodejs/node/commit/9ba5fd6bad)] - **build**: only check REPLACEME & DEP...X for releases (Rod Vagg) [#24575](https://github.com/nodejs/node/pull/24575) +* [[`1371a6f88b`](https://github.com/nodejs/node/commit/1371a6f88b)] - **doc**: simplify CODE\_OF\_CONDUCT.md (Rich Trott) [#23989](https://github.com/nodejs/node/pull/23989) +* [[`ad62971573`](https://github.com/nodejs/node/commit/ad62971573)] - **doc**: document that addMembership must be called once in a cluster (James M Snell) [#23746](https://github.com/nodejs/node/pull/23746) +* [[`8080a9bf40`](https://github.com/nodejs/node/commit/8080a9bf40)] - **http**: fix error check in `Execute()` (Brian White) [#25939](https://github.com/nodejs/node/pull/25939) +* [[`aedc7120ea`](https://github.com/nodejs/node/commit/aedc7120ea)] - **src**: fix bootstrap\_node on bsd (sylkat) [#22663](https://github.com/nodejs/node/pull/22663) +* [[`b5d464955a`](https://github.com/nodejs/node/commit/b5d464955a)] - **test**: fix test-repl-envvars (Anna Henningsen) [#25226](https://github.com/nodejs/node/pull/25226) + <a id="6.17.0"></a> ## 2018-02-28, Version 6.17.0 'Boron' (LTS), @rvagg diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 3cadf1e399e51b..f09e9a5beb023d 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -70,7 +70,7 @@ // get the full path before process.execPath is used. if (process.platform === 'openbsd') { const { realpathSync } = NativeModule.require('fs'); - process.execPath = realpathSync.native(process.execPath); + process.execPath = realpathSync(process.execPath); } Object.defineProperty(process, 'argv0', { diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 633e66aaef28a6..49f7a4bd77f36c 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -610,7 +610,28 @@ class Parser : public AsyncWrap { size_t nparsed = http_parser_execute(&parser_, &settings, data, len); - Save(); + enum http_errno err = HTTP_PARSER_ERRNO(&parser_); + + // Finish() + if (data == nullptr) { + // `http_parser_execute()` returns either `0` or `1` when `len` is 0 + // (part of the finishing sequence). + CHECK_EQ(len, 0); + switch (nparsed) { + case 0: + err = HPE_OK; + break; + case 1: + nparsed = 0; + break; + default: + UNREACHABLE(); + } + + // Regular Execute() + } else { + Save(); + } // Unassign the 'buffer_' variable current_buffer_.Clear(); @@ -624,7 +645,7 @@ class Parser : public AsyncWrap { Local<Integer> nparsed_obj = Integer::New(env()->isolate(), nparsed); // If there was a parse error in one of the callbacks // TODO(bnoordhuis) What if there is an error on EOF? - if (!parser_.upgrade && nparsed != len) { + if (!parser_.upgrade && err != HPE_OK) { enum http_errno err = HTTP_PARSER_ERRNO(&parser_); Local<Value> e = Exception::Error(env()->parse_error_string()); @@ -635,6 +656,11 @@ class Parser : public AsyncWrap { return scope.Escape(e); } + + // No return value is needed for `Finish()` + if (data == nullptr) { + return scope.Escape(Local<Value>()); + } return scope.Escape(nparsed_obj); } diff --git a/src/node_version.h b/src/node_version.h index aaae300aa52791..502a759c3ce794 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -8,7 +8,7 @@ #define NODE_VERSION_IS_LTS 1 #define NODE_VERSION_LTS_CODENAME "Boron" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) diff --git a/test/parallel/test-http-max-header-size.js b/test/parallel/test-http-max-header-size.js index 07fbe902963525..43dcbec5ab8967 100644 --- a/test/parallel/test-http-max-header-size.js +++ b/test/parallel/test-http-max-header-size.js @@ -1,6 +1,6 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const { spawnSync } = require('child_process'); const http = require('http'); @@ -9,3 +9,16 @@ assert.strictEqual(http.maxHeaderSize, 8 * 1024); const child = spawnSync(process.execPath, ['--max-http-header-size=10', '-p', 'http.maxHeaderSize']); assert.strictEqual(+child.stdout.toString().trim(), 10); + +{ + const server = http.createServer(common.mustNotCall()); + server.listen(0, common.mustCall(() => { + http.get({ + port: server.address().port, + headers: { foo: 'x'.repeat(http.maxHeaderSize + 1) } + }, common.mustNotCall()).once('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ECONNRESET'); + server.close(); + })); + })); +} diff --git a/test/parallel/test-repl-envvars.js b/test/parallel/test-repl-envvars.js index c0b1f53b3c2efc..5f597e0abb78ca 100644 --- a/test/parallel/test-repl-envvars.js +++ b/test/parallel/test-repl-envvars.js @@ -36,7 +36,7 @@ const tests = [ ]; function run(test) { - const env = Object.assign({}, process.env, test.env); + const env = test.env; const expected = test.expected; const opts = { terminal: true,