upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index b56f9f5..3af0189 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -61,8 +61,9 @@ static const char* pszSockSite[SOCK_SITES] = {
61 61
62static string SockAccountingText() 62static string SockAccountingText()
63{ 63{
64 long long nOpened[SOCK_SITES], nClosed[SOCK_SITES], nFailed[SOCK_SITES], nUntagged = 0; 64 long long nOpened[SOCK_SITES], nClosed[SOCK_SITES], nFailed[SOCK_SITES];
65 BtfSockSnapshot(nOpened, nClosed, nFailed, &nUntagged); 65 long long nCollided[SOCK_SITES], nUntagged = 0;
66 BtfSockSnapshot(nOpened, nClosed, nFailed, nCollided, &nUntagged);
66 67
67 long long nUnconn[SOCK_SITES]; 68 long long nUnconn[SOCK_SITES];
68 BtfSockLiveUnconnected(nUnconn); 69 BtfSockLiveUnconnected(nUnconn);
@@ -112,6 +113,19 @@ static string SockAccountingText()
112 str += strprintf(" %-24s %s\n", pszSockSite[i], strCodes.c_str()); 113 str += strprintf(" %-24s %s\n", pszSockSite[i], strCodes.c_str());
113 } 114 }
114 } 115 }
116
117 // A handle number handed out again while a site still claimed it. Windows
118 // only reuses a number after the last close, so this says that site's
119 // bookkeeping outlived its socket -- and it will close that number again,
120 // on somebody else's connection. Any value above zero is a bug with a name
121 // attached.
122 for (int i = 0; i < SOCK_SITES; i++)
123 {
124 if (nCollided[i] == 0)
125 continue;
126 str += strprintf(" handle reused while %s still claimed it: %lld\n",
127 pszSockSite[i], nCollided[i]);
128 }
115 return str; 129 return str;
116} 130}
117 131