upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/gui.cpp
diff options
context:
space:
mode:
authorBitflash <btf01@proton.me>2026-08-01 21:31:58 -0300
committerGitHub <noreply@github.com>2026-08-01 21:31:58 -0300
commitfc071066c9de259795a210e449b364ac126416ad (patch)
treee9f9b98f12f9eae51ed7f91b82036bf53207429b /src/gui.cpp
parent5358e2396ca6cb371400f685181ef420dcf12382 (diff)
net: stop closing a peer's socket twice (#103)
CNode::Disconnect() closed the socket and left the handle number in the object; ~CNode() then closed it again with a raw closesocket() the accounting never saw. There is no assignment of INVALID_SOCKET to CNode::hSocket anywhere in this tree, so the destructor's guard never fired. Between the two closes the OS can reissue that number, and the second close then takes down somebody else's connection. The same omission left a closed handle in the select() set, which fails every iteration and drives the recovery path that prints 'dropping node: its socket is no longer valid'. Measured A/B on the real network at matched socket volume: unpatched 552 sockets, 4 closes failing with 10038, 741 invalid-socket drops (all one peer), 11 peers held; patched 547 sockets, 0, 0, and 21 peers held. No protocol change.
Diffstat (limited to 'src/gui.cpp')
0 files changed, 0 insertions, 0 deletions