Page MenuHomePhabricator

net: check for invalid socket earlier and get the bind address earlier in CConnman::AcceptConnection()
ClosedPublic

Authored by PiRK on Feb 8 2022, 14:27.

Details

Summary

net: check for invalid socket earlier in CConnman::AcceptConnection()

This check is related to an accept() failure. So do the check earlier,
closer to the accept() call.

This will allow to isolate the accept()-specific code at the beginning
of CConnman::AcceptConnection() and reuse the code that follows it.

https://github.com/bitcoin/bitcoin/pull/20685/commits/25605895afe84b1765dd9da9240af22f99489df7

net: get the bind address earlier in CConnman::AcceptConnection()

Call GetBindAddress() earlier in CConnman::AcceptConnection(). That
is specific to the TCP protocol and makes the code below it reusable for
other protocols, if the caller provides addr_bind, retrieved by other
means.

https://github.com/bitcoin/bitcoin/pull/20685/commits/1f75a653dd3b24ba2e4383bf951a6e5a3d5ccbcf

This is a backport of core#20685 [4&5/20]

Depends on D11013

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable