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

Function shutdownWritable

lib/internal/http2/core.js:1975–1992  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

1973}
1974
1975function shutdownWritable(callback) {
1976 const handle = this[kHandle];
1977 if (!handle) return callback();
1978 const state = this[kState];
1979 if (state.shutdownWritableCalled) {
1980 debugStreamObj(this, 'shutdownWritable() already called');
1981 return callback();
1982 }
1983 state.shutdownWritableCalled = true;
1984
1985 const req = new ShutdownWrap();
1986 req.oncomplete = afterShutdown;
1987 req.callback = callback;
1988 req.handle = handle;
1989 const err = handle.shutdown(req);
1990 if (err === 1) // synchronous finish
1991 return afterShutdown.call(req, 0);
1992}
1993
1994function finishSendTrailers(stream, headersList) {
1995 // The stream might be destroyed and in that case

Callers

nothing calls this directly

Calls 3

debugStreamObjFunction · 0.85
callbackFunction · 0.50
callMethod · 0.45

Tested by

no test coverage detected