summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-util-update-options-buffer.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-11-01 11:48:11 -0700
committerJames M Snell <jasnell@gmail.com>2017-11-04 22:32:44 -0700
commit9f3d59eabb6564ad337a762d61ac767f9130e8a5 (patch)
treea0fdb43c530be18d6ed5dded16378c6f30d91da6 /test/parallel/test-http2-util-update-options-buffer.js
parent1f045f491a6a8d6ac193474f3856e2bdbd6847be (diff)
downloadandroid-node-v8-9f3d59eabb6564ad337a762d61ac767f9130e8a5.tar.gz
android-node-v8-9f3d59eabb6564ad337a762d61ac767f9130e8a5.tar.bz2
android-node-v8-9f3d59eabb6564ad337a762d61ac767f9130e8a5.zip
http2: refactor multiple internals
* eliminate pooling of Nghttp2Stream instances. After testing, the pooling is not having any tangible benefit and makes things more complicated. Simplify. Simplify. * refactor inbound headers * Enforce MAX_HEADERS_LIST setting and limit the number of header pairs accepted from the peer. Use the ENHANCE_YOUR_CALM error code when receiving either too many headers or too many octets. Use a vector to store the headers instead of a queue PR-URL: https://github.com/nodejs/node/pull/16676 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-http2-util-update-options-buffer.js')
-rw-r--r--test/parallel/test-http2-util-update-options-buffer.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/parallel/test-http2-util-update-options-buffer.js b/test/parallel/test-http2-util-update-options-buffer.js
index 952b9e2dd5..83c97c06b0 100644
--- a/test/parallel/test-http2-util-update-options-buffer.js
+++ b/test/parallel/test-http2-util-update-options-buffer.js
@@ -15,7 +15,8 @@ const IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS = 1;
const IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH = 2;
const IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS = 3;
const IDX_OPTIONS_PADDING_STRATEGY = 4;
-const IDX_OPTIONS_FLAGS = 5;
+const IDX_OPTIONS_MAX_HEADER_LIST_PAIRS = 5;
+const IDX_OPTIONS_FLAGS = 6;
{
updateOptionsBuffer({
@@ -23,7 +24,8 @@ const IDX_OPTIONS_FLAGS = 5;
maxReservedRemoteStreams: 2,
maxSendHeaderBlockLength: 3,
peerMaxConcurrentStreams: 4,
- paddingStrategy: 5
+ paddingStrategy: 5,
+ maxHeaderListPairs: 6
});
strictEqual(optionsBuffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE], 1);
@@ -31,6 +33,7 @@ const IDX_OPTIONS_FLAGS = 5;
strictEqual(optionsBuffer[IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH], 3);
strictEqual(optionsBuffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS], 4);
strictEqual(optionsBuffer[IDX_OPTIONS_PADDING_STRATEGY], 5);
+ strictEqual(optionsBuffer[IDX_OPTIONS_MAX_HEADER_LIST_PAIRS], 6);
const flags = optionsBuffer[IDX_OPTIONS_FLAGS];
@@ -39,6 +42,7 @@ const IDX_OPTIONS_FLAGS = 5;
ok(flags & (1 << IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH));
ok(flags & (1 << IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS));
ok(flags & (1 << IDX_OPTIONS_PADDING_STRATEGY));
+ ok(flags & (1 << IDX_OPTIONS_MAX_HEADER_LIST_PAIRS));
}
{
@@ -48,7 +52,8 @@ const IDX_OPTIONS_FLAGS = 5;
maxDeflateDynamicTableSize: 1,
maxReservedRemoteStreams: 2,
peerMaxConcurrentStreams: 4,
- paddingStrategy: 5
+ paddingStrategy: 5,
+ maxHeaderListPairs: 6
});
strictEqual(optionsBuffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE], 1);
@@ -56,6 +61,7 @@ const IDX_OPTIONS_FLAGS = 5;
strictEqual(optionsBuffer[IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH], 0);
strictEqual(optionsBuffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS], 4);
strictEqual(optionsBuffer[IDX_OPTIONS_PADDING_STRATEGY], 5);
+ strictEqual(optionsBuffer[IDX_OPTIONS_MAX_HEADER_LIST_PAIRS], 6);
const flags = optionsBuffer[IDX_OPTIONS_FLAGS];
@@ -64,4 +70,5 @@ const IDX_OPTIONS_FLAGS = 5;
ok(!(flags & (1 << IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH)));
ok(flags & (1 << IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS));
ok(flags & (1 << IDX_OPTIONS_PADDING_STRATEGY));
+ ok(flags & (1 << IDX_OPTIONS_MAX_HEADER_LIST_PAIRS));
}