Add ioq3 server fixes and improvement

- Add a rate limit to protect against DoS attacks
- Better IPv6 support
This commit is contained in:
smallmodel 2024-08-31 20:45:05 +02:00
parent 9de71e3529
commit 11f5870a8b
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
10 changed files with 966 additions and 427 deletions

View file

@ -875,6 +875,18 @@ void MSG_ReadData( msg_t *msg, void *data, int len ) {
}
}
// a string hasher which gives the same hash value even if the
// string is later modified via the legacy MSG read/write code
int MSG_HashKey(const char *string, int maxlen) {
int register hash, i;
hash = 0;
for (i = 0; i < maxlen && string[i] != '\0'; i++) {
hash += string[i] * (119 + i);
}
hash = (hash ^ (hash >> 10) ^ (hash >> 20));
return hash;
}
/*
=============================================================================