OverviewFilesCommitsIssuesDocsReleasesPeers

hyperswarm-peer commits / 272d72c

udx: say when a peer is dropped for silence, and when keepalives start
Dropping a silent peer is a decision this layer makes on its own and is indistinguishable from the peer leaving unless it says so; it was a DHT_LOG, compiled out of release builds. Now always logged, plus one line when the first keepalive goes out to a peer. Already in the Linux release .so (built 2026-09-11 from this working tree); committed so the Windows DLL builds from the same source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
272d72cc2f6b098c712514312f04a2b8aff025c8
by plankatron <fleeky@gmail.com> · 2026-09-29T21:26:09.000Z

Changed files (2) +13 -1

src/udx_transport.cpp +12 -1
……@@ -1140,7 +1140,11 @@ void UdxTransport::_sweep_keepalive(uint64_t now_ms) {
11401140 if (peer->last_send_ms == 0) peer->last_send_ms = now_ms;
11411141
11421142 if (peer->peer_keepalive && now_ms - peer->last_recv_ms > PEER_DEAD_MS) {
1143 DHT_LOG("[UdxTransport] peer %d silent for %llums — disconnecting\n",
1143 // ⛔ NOT DHT_LOG. Dropping a peer for silence is a decision this
1144 // layer makes ON ITS OWN, and it is indistinguishable from the peer
1145 // leaving unless it says so. Compiled out, it is exactly the kind of
1146 // invisible verdict that made "joined" mean nothing.
1147 fprintf(stderr, "[UdxTransport] peer %d silent for %llums — dropping it\n",
11441148 peer->godot_peer_id,
11451149 (unsigned long long)(now_ms - peer->last_recv_ms));
11461150 dead.push_back(kv.first);
……@@ -1149,6 +1153,13 @@ void UdxTransport::_sweep_keepalive(uint64_t now_ms) {
11491153
11501154 if (now_ms - peer->last_send_ms >= PEER_KEEPALIVE_INTERVAL_MS) {
11511155 _send_encrypted(peer, nullptr, 0); // stamps last_send_ms
1156 peer->keepalives_sent++;
1157 // Once, when the first one goes out: enough to prove the mechanism
1158 // is running without a line every five seconds per peer.
1159 if (peer->keepalives_sent == 1) {
1160 fprintf(stderr, "[UdxTransport] peer %d: keepalives started\n",
1161 peer->godot_peer_id);
1162 }
11521163 }
11531164 }
11541165
src/udx_transport.h +1 -0
……@@ -96,6 +96,7 @@ struct PeerConnection {
9696 // silence is not evidence of death — it may simply be a build that predates
9797 // keepalives, and killing it would be a flag day for idle connections.
9898 bool peer_keepalive = false;
99 uint64_t keepalives_sent = 0;
99100
100101 // Protomux multiplexer (created after Noise handshake completes).
101102 Protomux *mux = nullptr;