Spreading packets around TCP relays causes issues with the audio and video.

Make each connection stick to the same relay.
This commit is contained in:
irungentoo 2014-07-29 09:08:23 -04:00
parent e1158be5a6
commit df6e6dfd6b
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -414,7 +414,7 @@ static int send_packet_to(const Net_Crypto *c, int crypt_connection_id, const ui
//TODO: detect and kill bad relays. //TODO: detect and kill bad relays.
uint32_t i; uint32_t i;
unsigned int r = rand(); unsigned int r = crypt_connection_id;
for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) { for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) {
if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */ if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */