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

[8.x] Backport http2 changes from 9.x #20456

Closed
wants to merge 77 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0d7ce68
src: minor refactoring to StreamBase writes
addaleax Dec 9, 2017
16a3ad0
src: replace SetAccessor w/ SetAccessorProperty
jure Dec 13, 2017
c4572cc
test: add hasCrypto when using binding('crypto')
danbev Dec 26, 2017
9557fb9
test: make test-tls-external-accessor agnostic
Trott Oct 17, 2017
d5ddbd9
perf_hooks: refactor internals
jasnell Dec 21, 2017
ed53cb7
http2: simplify onSelectPadding
addaleax Dec 17, 2017
14d0bab
deps: update nghttp2 to 1.29.0
jasnell Dec 28, 2017
584379f
src: add optional keep-alive object to SetImmediate
addaleax Nov 21, 2017
e725a4a
http2: don't call into JS from GC
addaleax Nov 21, 2017
2d389f9
http2: only schedule write when necessary
addaleax Nov 21, 2017
367b848
http2: be sure to destroy the Http2Stream
jasnell Nov 27, 2017
988f11f
http2: cleanup Http2Stream/Http2Session destroy
jasnell Dec 12, 2017
10e9b9d
http2: remove redundant write indirection
addaleax Dec 17, 2017
93d00ab
http2: refactor outgoing write mechanism
addaleax Dec 17, 2017
f68325c
http2: convert Http2Settings to an AsyncWrap
jasnell Dec 18, 2017
5036d0f
http2: fix compiling with `--debug-http2`
addaleax Dec 25, 2017
3490359
http2: keep session objects alive during Http2Scope
addaleax Dec 25, 2017
3bf3eb8
http2: implement ref() and unref() on client sessions
kjin Dec 11, 2017
e92be6a
http2: perf_hooks integration
jasnell Dec 20, 2017
7767aaa
http2,perf_hooks: perf state using AliasedBuffer
kfarnung Jan 22, 2018
936337a
http2: strictly limit number on concurrent streams
jasnell Nov 21, 2017
644bd5f
http2: add altsvc support
jasnell Dec 29, 2017
6466ac1
tls: set servername on client side too
jasnell Jan 1, 2018
fc97666
http2: add initial support for originSet
jasnell Jan 1, 2018
08f599b
http2: add aligned padding strategy
jasnell Jan 1, 2018
3601bc4
http2: properly handle already closed stream error
jasnell Jan 2, 2018
21c0a8c
doc: add docs for common/http2.js utility
jasnell Jan 2, 2018
098d052
src: silence http2 -Wunused-result warnings
cjihrig Jan 2, 2018
3a5e97f
http2: implement maxSessionMemory
jasnell Jan 3, 2018
b3d09de
http2: verify that a dependency cycle may exist
jasnell Jan 3, 2018
26c8b3c
doc: grammar fixes in http2.md
Trott Jan 4, 2018
0954785
http2: verify flood error and unsolicited frames
jasnell Jan 3, 2018
5fe065b
doc: correct spelling
sreepurnajasti Dec 29, 2017
ea21157
doc: fix code nits in common/README
vsemozhetbyt Jan 4, 2018
b768f6f
doc: re-alphabetise sections in common/README.md
vsemozhetbyt Jan 4, 2018
4eb9cca
doc: compact eslint directives in common/README
vsemozhetbyt Jan 4, 2018
39a0d35
http2: use aliased buffer for perf stats, add stats
jasnell Jan 6, 2018
3d13a16
doc: update pushStream docs to use err first
jasnell Jan 10, 2018
de1e52e
doc: fix s/rstStream/close in example
jasnell Jan 11, 2018
6a24afd
perf_hooks,http2: add performance.clear()
jasnell Jan 8, 2018
1d5ab00
http2: remember sent headers
jasnell Jan 8, 2018
39e27fd
src: remove declarations for missing functions
addaleax Jan 13, 2018
dcb986e
src,doc,test: Fix common misspellings
silverwind Jan 14, 2018
3535f6f
doc: fix typo in http2stream.close param default
maritz Jan 15, 2018
f494635
src: introduce internal buffer slice constructor
addaleax Jan 8, 2018
cf46b95
http2: refactor read mechanism
addaleax Jan 8, 2018
9ff0e8c
http2: add checks for server close callback
jasnell Jan 16, 2018
4d7549b
doc: fix documentation of http2Stream.pushstream()
nephross Jan 19, 2018
c8a6d8a
doc: unify type linkification
vsemozhetbyt Jan 27, 2018
bcfef86
doc: remove removed apis from http2 docs
kjin Jan 29, 2018
b83c03e
doc: fix typo in http2.md
vsemozhetbyt Feb 6, 2018
7e26992
http2: add http fallback options to .createServer
hekike Oct 27, 2017
740d445
http: add options to http.createServer()
Oct 19, 2017
7e2181a
http2: add req and res options to server creation
Oct 5, 2017
7b03c17
http2: use `_final` instead of `on('finish')`
addaleax Feb 7, 2018
a10b365
doc: warn against concurrent http2stream.respondWithFD
addaleax Feb 13, 2018
c32ac60
src: add nullptr check for session in DEBUG macro
danbev Feb 16, 2018
7c2bc72
doc: fix typo in http2.md
vsemozhetbyt Feb 19, 2018
ab416d7
deps,src: align ssize_t ABI between Node & nghttp2
addaleax Feb 4, 2018
0cdcd58
http2: fix condition where data is lost
mcollina Feb 19, 2018
265baaf
http2: send error text in case of ALPN mismatch
addaleax Feb 25, 2018
78b6542
http2: use original error for cancelling pending streams
addaleax Feb 25, 2018
c46ee1f
http2: fix endless loop when writing empty string
addaleax Feb 22, 2018
74212aa
test: check endless loop while writing empty string
XadillaX Feb 11, 2018
16e9b8d
http2: fix flaky test-http2-https-fallback
mcollina Mar 2, 2018
4188136
http2: no stream destroy while its data is on the wire
addaleax Feb 26, 2018
89c42a3
doc: add note about browsers and HTTP/2
styfle Mar 20, 2018
c0c9664
http2: remove some unnecessary next ticks
jasnell Mar 19, 2018
f6387a4
doc: rename HTTP2 to HTTP/2
TimothyGu Mar 26, 2018
3ba1beb
test: http2 stream.respond() error checks
trivikr Feb 19, 2018
d932237
http2: destroy() stream, upon errnoException
SirR4T Mar 16, 2018
0682140
doc: guard against md list parsing edge case
vsemozhetbyt Mar 28, 2018
9d885b9
test: http2 errors on req.close()
trivikr Feb 18, 2018
dedf0c0
http2: callback valid check before closing request
trivikr Feb 28, 2018
7d3ff81
doc, http2: add sections for server.close()
chrismilleruk Apr 4, 2018
c53bc0f
doc: add Http2Session.connecting property
pietermees Apr 6, 2018
b2fd504
http2: emit session connect on next tick
pietermees Apr 9, 2018
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
Prev Previous commit
Next Next commit
test: check endless loop while writing empty string
Refs: #18673
PR-URL: #18924
Refs: #18673
Refs: https://github.com/nodejs/node/blob/v9.5.0/src/node_http2.cc#L1481-L1484
Refs: https://github.com/nodejs/node/blob/v9.5.0/lib/_http_outgoing.js#L659-L661
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
XadillaX authored and kjin committed May 1, 2018
commit 74212aacc4ac8c32ac90f04324f28c4d6aca6eed
54 changes: 54 additions & 0 deletions test/parallel/test-http2-client-write-empty-string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict';

const assert = require('assert');
const http2 = require('http2');

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');

for (const chunkSequence of [
[ '' ],
[ '', '' ]
]) {
const server = http2.createServer();
server.on('stream', common.mustCall((stream, headers, flags) => {
stream.respond({ 'content-type': 'text/html' });

let data = '';
stream.on('data', common.mustNotCall((chunk) => {
data += chunk.toString();
}));
stream.on('end', common.mustCall(() => {
stream.end(`"${data}"`);
}));
}));

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

const req = client.request({
':method': 'POST',
':path': '/'
});

req.on('response', common.mustCall((headers) => {
assert.strictEqual(headers[':status'], 200);
assert.strictEqual(headers['content-type'], 'text/html');
}));

let data = '';
req.setEncoding('utf8');
req.on('data', common.mustCallAtLeast((d) => data += d));
req.on('end', common.mustCall(() => {
assert.strictEqual(data, '""');
server.close();
client.close();
}));

for (const chunk of chunkSequence)
req.write(chunk);
req.end();
}));
}