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

Function onOrigin

lib/internal/http2/core.js:719–736  ·  view source on GitHub ↗
(origins)

Source from the content-addressed store, hash-verified

717}
718
719function onOrigin(origins) {
720 const session = this[kOwner];
721 if (session.destroyed)
722 return;
723 debugSessionObj(session, 'origin received: %j', origins);
724 session[kUpdateTimer]();
725 if (!session.encrypted || session.destroyed)
726 return undefined;
727 const originSet = initOriginSet(session);
728 for (let n = 0; n < origins.length; n++) {
729 if (originSet.size >= session[kMaxOriginSetSize]) {
730 session.destroy(new ERR_HTTP2_TOO_MANY_ORIGINS(session[kMaxOriginSetSize]));
731 return;
732 }
733 originSet.add(origins[n]);
734 }
735 session.emit('origin', origins);
736}
737
738// Receiving a GOAWAY frame from the connected peer is a signal that no
739// new streams should be created. If the code === NGHTTP2_NO_ERROR, we

Callers

nothing calls this directly

Calls 5

debugSessionObjFunction · 0.85
initOriginSetFunction · 0.85
addMethod · 0.65
destroyMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…