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 Andrew Johnson committed 2026-07-23 18:17:02 -05:00
1 parent 93b4598dcd
commit c6ad5614c6
1 file changed
+9 -3
+9 -3
View File
@@ -2437,9 +2437,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;