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-11-03 16:18:04 +01:00
1 parent 3bc1d552a6
commit 6a0300c123
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;