mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Add ioq3 server fixes and improvement
- Add a rate limit to protect against DoS attacks - Better IPv6 support
This commit is contained in:
parent
9de71e3529
commit
11f5870a8b
10 changed files with 966 additions and 427 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue