| … | … | @@ -1140,7 +1140,11 @@ void UdxTransport::_sweep_keepalive(uint64_t now_ms) { |
| 1140 | 1140 | if (peer->last_send_ms == 0) peer->last_send_ms = now_ms; |
| 1141 | 1141 | |
| 1142 | 1142 | 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", |
| 1144 | 1148 | peer->godot_peer_id, |
| 1145 | 1149 | (unsigned long long)(now_ms - peer->last_recv_ms)); |
| 1146 | 1150 | dead.push_back(kv.first); |
| … | … | @@ -1149,6 +1153,13 @@ void UdxTransport::_sweep_keepalive(uint64_t now_ms) { |
| 1149 | 1153 | |
| 1150 | 1154 | if (now_ms - peer->last_send_ms >= PEER_KEEPALIVE_INTERVAL_MS) { |
| 1151 | 1155 | _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 | } |
| 1152 | 1163 | } |
| 1153 | 1164 | } |
| 1154 | 1165 | |