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

Function socketOnEnd

lib/_http_server.js:923–939  ·  view source on GitHub ↗
(server, socket, parser, state)

Source from the content-addressed store, hash-verified

921}
922
923function socketOnEnd(server, socket, parser, state) {
924 const ret = parser.finish();
925
926 if (ret instanceof Error) {
927 debug('parse error');
928 // socketOnError has additional logic and will call socket.destroy(err).
929 socketOnError.call(socket, ret);
930 } else if (!server.httpAllowHalfOpen) {
931 socket.end();
932 } else if (state.outgoing.length) {
933 state.outgoing[state.outgoing.length - 1]._last = true;
934 } else if (socket._httpMessage) {
935 socket._httpMessage._last = true;
936 } else {
937 socket.end();
938 }
939}
940
941function socketOnData(server, socket, parser, state, d) {
942 assert(!socket._paused);

Callers

nothing calls this directly

Calls 4

debugFunction · 0.50
finishMethod · 0.45
callMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…