summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js
diff options
context:
space:
mode:
Diffstat (limited to 'includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js')
-rw-r--r--includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js102
1 files changed, 0 insertions, 102 deletions
diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js
deleted file mode 100644
index 89a0ac4..0000000
--- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js
+++ /dev/null
@@ -1,102 +0,0 @@
-'use strict';
-const {ERR_HTTP2_NO_SOCKET_MANIPULATION} = require('./errors.js');
-
-/* istanbul ignore file */
-/* https://github.com/nodejs/node/blob/6eec858f34a40ffa489c1ec54bb24da72a28c781/lib/internal/http2/compat.js#L195-L272 */
-
-const proxySocketHandler = {
- has(stream, property) {
- // Replaced [kSocket] with .socket
- const reference = stream.session === undefined ? stream : stream.session.socket;
- return (property in stream) || (property in reference);
- },
-
- get(stream, property) {
- switch (property) {
- case 'on':
- case 'once':
- case 'end':
- case 'emit':
- case 'destroy':
- return stream[property].bind(stream);
- case 'writable':
- case 'destroyed':
- return stream[property];
- case 'readable':
- if (stream.destroyed) {
- return false;
- }
-
- return stream.readable;
- case 'setTimeout': {
- const {session} = stream;
- if (session !== undefined) {
- return session.setTimeout.bind(session);
- }
-
- return stream.setTimeout.bind(stream);
- }
-
- case 'write':
- case 'read':
- case 'pause':
- case 'resume':
- throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
- default: {
- // Replaced [kSocket] with .socket
- const reference = stream.session === undefined ? stream : stream.session.socket;
- const value = reference[property];
-
- return typeof value === 'function' ? value.bind(reference) : value;
- }
- }
- },
-
- getPrototypeOf(stream) {
- if (stream.session !== undefined) {
- // Replaced [kSocket] with .socket
- return Reflect.getPrototypeOf(stream.session.socket);
- }
-
- return Reflect.getPrototypeOf(stream);
- },
-
- set(stream, property, value) {
- switch (property) {
- case 'writable':
- case 'readable':
- case 'destroyed':
- case 'on':
- case 'once':
- case 'end':
- case 'emit':
- case 'destroy':
- stream[property] = value;
- return true;
- case 'setTimeout': {
- const {session} = stream;
- if (session === undefined) {
- stream.setTimeout = value;
- } else {
- session.setTimeout = value;
- }
-
- return true;
- }
-
- case 'write':
- case 'read':
- case 'pause':
- case 'resume':
- throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
- default: {
- // Replaced [kSocket] with .socket
- const reference = stream.session === undefined ? stream : stream.session.socket;
- reference[property] = value;
- return true;
- }
- }
- }
-};
-
-module.exports = proxySocketHandler;