summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-07-29 09:08:23 -0400
committerirungentoo <irungentoo@gmail.com>2014-07-29 09:08:23 -0400
commitdf6e6dfd6bbffec9b63ee5b246b452f429b02e6d (patch)
tree065a630982f9a6742a93be1124c6a5ac270366fe /toxcore
parente1158be5a6fa10187dc70ef88a0b7c6dc0cf18ac (diff)
Spreading packets around TCP relays causes issues with the audio and video.
Make each connection stick to the same relay.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/net_crypto.c2
1 files changed, 1 insertions, 1 deletions
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
414 //TODO: detect and kill bad relays. 414 //TODO: detect and kill bad relays.
415 uint32_t i; 415 uint32_t i;
416 416
417 unsigned int r = rand(); 417 unsigned int r = crypt_connection_id;
418 418
419 for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) { 419 for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) {
420 if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */ 420 if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */