Implements a callback that is invoked once http/3 settings are received. Background, http/3 settings usually arrive a bit later than connection establishment, and e.g. for webtransport these settings are used to indicate support. So e.g. the examples for quiche from google, wait for the settings to arrive. (This is different to http/2). The implemented callback mechanism allows to wait for the settings to arrive until connection attempts are made. As settings are stored in the generic applications option object, the callback's name refers to the application rather than the settings. Whether this is a good choice is debatable. Fixes: https://github.com/nodejs/node/issues/63553 Signed-off-by: Marten Richter <marten.richter@freenet.de> PR-URL: https://github.com/nodejs/node/pull/63558 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
100 lines
2.5 KiB
JavaScript
100 lines
2.5 KiB
JavaScript
'use strict';
|
|
|
|
// TODO(@jasnell) Temporarily ignoring c8 covrerage for this file while tests
|
|
// are still being developed.
|
|
/* c8 ignore start */
|
|
|
|
const {
|
|
Symbol,
|
|
} = primordials;
|
|
|
|
const {
|
|
getOptionValue,
|
|
} = require('internal/options');
|
|
|
|
if (!process.features.quic || !getOptionValue('--experimental-quic')) {
|
|
return;
|
|
}
|
|
|
|
const {
|
|
customInspectSymbol: kInspect,
|
|
} = require('internal/util');
|
|
|
|
const {
|
|
kHandle: kKeyObjectHandle,
|
|
} = require('internal/crypto/util');
|
|
|
|
// Symbols used to hide various private properties and methods from the
|
|
// public API.
|
|
|
|
const kAttachFileHandle = Symbol('kAttachFileHandle');
|
|
const kBlocked = Symbol('kBlocked');
|
|
const kConnect = Symbol('kConnect');
|
|
const kDrain = Symbol('kDrain');
|
|
const kDatagram = Symbol('kDatagram');
|
|
const kDatagramStatus = Symbol('kDatagramStatus');
|
|
const kEarlyDataRejected = Symbol('kEarlyDataRejected');
|
|
const kFinishClose = Symbol('kFinishClose');
|
|
const kGoaway = Symbol('kGoaway');
|
|
const kHandshake = Symbol('kHandshake');
|
|
const kHandshakeCompleted = Symbol('kHandshakeCompleted');
|
|
const kVerifyPeer = Symbol('kVerifyPeer');
|
|
const kHeaders = Symbol('kHeaders');
|
|
const kKeylog = Symbol('kKeylog');
|
|
const kListen = Symbol('kListen');
|
|
const kQlog = Symbol('kQlog');
|
|
const kNewSession = Symbol('kNewSession');
|
|
const kNewStream = Symbol('kNewStream');
|
|
const kNewToken = Symbol('kNewToken');
|
|
const kStreamCallbacks = Symbol('kStreamCallbacks');
|
|
const kOrigin = Symbol('kOrigin');
|
|
const kOwner = Symbol('kOwner');
|
|
const kPathValidation = Symbol('kPathValidation');
|
|
const kPrivateConstructor = Symbol('kPrivateConstructor');
|
|
const kRemoveSession = Symbol('kRemoveSession');
|
|
const kRemoveStream = Symbol('kRemoveStream');
|
|
const kReset = Symbol('kReset');
|
|
const kSendHeaders = Symbol('kSendHeaders');
|
|
const kSessionApplication = Symbol('kSessionApplication');
|
|
const kSessionTicket = Symbol('kSessionTicket');
|
|
const kTrailers = Symbol('kTrailers');
|
|
const kVersionNegotiation = Symbol('kVersionNegotiation');
|
|
|
|
module.exports = {
|
|
kAttachFileHandle,
|
|
kBlocked,
|
|
kConnect,
|
|
kDatagram,
|
|
kDatagramStatus,
|
|
kDrain,
|
|
kEarlyDataRejected,
|
|
kFinishClose,
|
|
kGoaway,
|
|
kHandshake,
|
|
kHandshakeCompleted,
|
|
kVerifyPeer,
|
|
kHeaders,
|
|
kInspect,
|
|
kKeylog,
|
|
kKeyObjectHandle,
|
|
kListen,
|
|
kNewSession,
|
|
kNewStream,
|
|
kNewToken,
|
|
kStreamCallbacks,
|
|
kOrigin,
|
|
kOwner,
|
|
kQlog,
|
|
kPathValidation,
|
|
kPrivateConstructor,
|
|
kRemoveSession,
|
|
kRemoveStream,
|
|
kReset,
|
|
kSendHeaders,
|
|
kSessionApplication,
|
|
kSessionTicket,
|
|
kTrailers,
|
|
kVersionNegotiation,
|
|
};
|
|
|
|
/* c8 ignore stop */
|