MCPcopy Create free account
hub / github.com/expressjs/compression / closeHttp2

Function closeHttp2

test/compression.js:1014–1032  ·  view source on GitHub ↗
(client, server, callback)

Source from the content-addressed store, hash-verified

1012}
1013
1014function closeHttp2 (client, server, callback) {
1015 if (typeof client.shutdown === 'function') {
1016 // this is the node v8.x way of closing the connections
1017 client.shutdown({}, function () {
1018 server.close(function () {
1019 callback()
1020 })
1021 })
1022 } else {
1023 // this is the node v9.x onwards way of closing the connections
1024 client.close(function () {
1025 // force existing connections to time out after 1ms.
1026 // this is done to force the server to close in some cases where it wouldn't do it otherwise.
1027 server.close(function () {
1028 callback()
1029 })
1030 })
1031 }
1032}
1033
1034function shouldHaveBodyLength (length) {
1035 return function (res) {

Callers 1

compression.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected