rsrv: old TCP client tar pit

A short message could underflow, leaving a too old client stuck
in a tar pit.  An acceptable outcome, but not intended.
Instead, send back errors to each message.
This commit is contained in:
Michael Davidsaver authored and Dirk Zimoch committed 2026-10-14 15:12:06 +02:00
1 parent c235135450
commit 3cd526411f
1 file changed
+9 -3
+9 -3
View File
@@ -2494,9 +2494,15 @@ int camessage ( struct client *client )
SEND_UNLOCK(client);
log_header ( "CAS: Client version too old",
client, &msg, 0, nmsg );
client->recvBytesToDrain = msgsize - bytes_left;
client->recv.stk = client->recv.cnt;
status = RSRV_OK;
if (msgsize >= bytes_left) {
client->recvBytesToDrain = msgsize - bytes_left;
client->recv.stk = client->recv.cnt;
status = RSRV_OK;
break;
} else { // msgsize < bytes_left
client->recv.stk += msgsize;
continue;
}
} else {
/* silently ignore UDP from old clients */
status = RSRV_ERROR;