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

Method onMessageBegin

deps/undici/undici.js:7344–7359  ·  view source on GitHub ↗

* @returns {0|-1}

()

Source from the content-addressed store, hash-verified

7342 * @returns {0|-1}
7343 */
7344 onMessageBegin() {
7345 const { socket, client } = this;
7346 if (socket.destroyed) {
7347 return -1;
7348 }
7349 if (client[kRunning] === 0) {
7350 util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
7351 return -1;
7352 }
7353 const request = client[kQueue][client[kRunningIdx]];
7354 if (!request) {
7355 return -1;
7356 }
7357 request.onResponseStarted();
7358 return 0;
7359 }
7360 /**
7361 * @param {Buffer} buf
7362 * @returns {number}

Callers 1

lazyllhttpFunction · 0.45

Calls 2

onResponseStartedMethod · 0.65
destroyMethod · 0.45

Tested by

no test coverage detected