rcon: don't expect two packets for authentication
Build and test / build (push) Successful in 57s
Build and test / test (push) Successful in 1m4s
Build and test / build-freebsd-cross (push) Successful in 1m58s

This commit is contained in:
2026-06-12 01:08:34 +09:00
parent 4a2469bf43
commit 2432dfe3bb
-15
View File
@@ -176,21 +176,6 @@ int rcon_authenticate(int sockfd, const char *password) {
return -1;
}
// TODO: why do we expect two packets in response to a single auth request?
// if this is the correct behaviour, please document it or else remove it.
// Try to read second packet (may timeout, which is OK)
rcon_packet_t response2;
int result = recv_packet(sockfd, &response2);
if (result == 0) {
printf("received second auth packet: id=%d, type=%d\n", response2.id, response2.type);
if (response2.type != RCON_SERVERDATA_AUTH_RESPONSE) {
fprintf(stderr, "authentication failed - unexpected second packet type: %d\n", response2.type);
return -1;
}
} else if (result == -2) {
printf("no second packet (timeout - this is normal)\n");
}
printf("authenticated successfully\n");
return 0;
}