MCPcopy Create free account
hub / github.com/nodejs/node / [kMaybeDestroy]

Method [kMaybeDestroy]

lib/internal/http2/core.js:1669–1682  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

1667 // * error is not undefined/null
1668 // * session is closed and there are no more pending or open streams
1669 [kMaybeDestroy](error) {
1670 if (error == null) {
1671 const handle = this[kHandle];
1672 const hasPendingData = !!handle && handle.hasPendingData();
1673 const state = this[kState];
1674 // Do not destroy if we're not closed and there are pending/open streams
1675 if (!this.closed ||
1676 state.streams.size > 0 ||
1677 state.pendingStreams.size > 0 || hasPendingData) {
1678 return;
1679 }
1680 }
1681 this.destroy(error);
1682 }
1683
1684 _onTimeout() {
1685 callTimeout(this, this);

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.95

Tested by

no test coverage detected