From df6e6dfd6bbffec9b63ee5b246b452f429b02e6d Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 29 Jul 2014 09:08:23 -0400 Subject: [PATCH] Spreading packets around TCP relays causes issues with the audio and video. Make each connection stick to the same relay. --- toxcore/net_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index c3ae3663..7607015e 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -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. uint32_t i; - unsigned int r = rand(); + unsigned int r = crypt_connection_id; 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. */