MCPcopy Index your code
hub / github.com/nodejs/node / processEndpointOption

Function processEndpointOption

lib/internal/quic/quic.js:4851–4871  ·  view source on GitHub ↗

* @param {EndpointOptions|QuicEndpoint|undefined} endpoint * @param {boolean} reuseEndpoint * @param {boolean} forServer * @param {SocketAddress} [targetAddress] * @returns {QuicEndpoint}

(endpoint,
                               reuseEndpoint = true,
                               forServer = false,
                               targetAddress)

Source from the content-addressed store, hash-verified

4849 * @returns {QuicEndpoint}
4850 */
4851function processEndpointOption(endpoint,
4852 reuseEndpoint = true,
4853 forServer = false,
4854 targetAddress) {
4855 if (isQuicEndpoint(endpoint)) {
4856 // We were given an existing endpoint. Use it as-is.
4857 return endpoint;
4858 }
4859 if (endpoint !== undefined) {
4860 // We were given endpoint options. If reuse is enabled, we could
4861 // look for a matching endpoint, but endpoint options imply the
4862 // caller wants specific configuration. Create a new one.
4863 return new QuicEndpoint(endpoint);
4864 }
4865 // No endpoint specified. Try to reuse an existing one if allowed.
4866 if (reuseEndpoint && !forServer) {
4867 const existing = findSuitableEndpoint(targetAddress);
4868 if (existing !== undefined) return existing;
4869 }
4870 return new QuicEndpoint();
4871}
4872
4873/**
4874 * Validate and extract identity options (keys, certs) from an SNI entry.

Callers 1

processSessionOptionsFunction · 0.85

Calls 1

findSuitableEndpointFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…