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

Function wrapSessionState

lib/internal/tls/wrap.js:126–140  ·  view source on GitHub ↗
(session, options)

Source from the content-addressed store, hash-verified

124}
125
126function wrapSessionState(session, options) {
127 if (!Buffer.isBuffer(session) || options?.isServer)
128 return session;
129
130 const servername = Buffer.from(getSessionServerIdentity(options), 'utf8');
131 const servernameLength = Buffer.allocUnsafe(2);
132 servernameLength.writeUInt16BE(servername.length, 0);
133
134 return Buffer.concat([
135 kTLSSessionStatePrefix,
136 servernameLength,
137 servername,
138 session,
139 ]);
140}
141
142function unwrapSessionState(session) {
143 if (!Buffer.isBuffer(session) ||

Callers 2

onnewsessionclientFunction · 0.85
wrap.jsFile · 0.85

Calls 3

getSessionServerIdentityFunction · 0.85
concatMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…