Skip to content

net: use `_server` for internal book-keeping

Rodrigo Muino Tomonari requested to merge github/fork/indutny/fix/gh-5083 into master

The role of this.server is now split between this._server and this.server. Where the first one is used for counting active connections of net.Server, and the latter one is just a public API for users' consumption.

The reasoning for this is simple, TLSSocket instances wrap net.Socket instances, thus both refer to the net.Server through the this.server property. However, only one of them should be used for net.Server connection count book-keeping, otherwise double-decrement will happen on socket destruction.

Fix: #5083 (closed)

cc @nodejs/http @nodejs/crypto

Merge request reports

Loading