MCPcopy Create free account
hub / github.com/nodejs/node / onEnd

Function onEnd

deps/undici/undici.js:9176–9188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9174 }
9175 __name(onResponse, "onResponse");
9176 function onEnd() {
9177 const stream = this;
9178 const state = stream[kRequestStreamState];
9179 const { request } = state;
9180 stream.off("end", onEnd);
9181 if (state.responseReceived) {
9182 if (!request.aborted && !request.completed) {
9183 state.pendingEnd = true;
9184 }
9185 } else {
9186 state.abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true);
9187 }
9188 }
9189 __name(onEnd, "onEnd");
9190 function onError(err) {
9191 const stream = this;

Callers

nothing calls this directly

Calls 2

abortMethod · 0.65
offMethod · 0.45

Tested by

no test coverage detected