summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzugz (tox) <mbays+tox@sdf.org>2020-03-21 00:00:00 +0000
committeriphydf <iphydf@users.noreply.github.com>2020-03-22 01:38:47 +0000
commitda93f054fe88c1c99ab8814deb8957c1ece77b8d (patch)
tree229259fdaa103c27ca2e5a5b1ee43e57a38a6aa8
parentba953148456a8fe1f04509077674375571b1ed05 (diff)
fix typo: now we periodically try to send direct packets when connected by tcp
-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 6a69bb5b..fb69b768 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -696,7 +696,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t
696 // TODO(irungentoo): a better way of sending packets directly to confirm the others ip. 696 // TODO(irungentoo): a better way of sending packets directly to confirm the others ip.
697 const uint64_t current_time = mono_time_get(c->mono_time); 697 const uint64_t current_time = mono_time_get(c->mono_time);
698 698
699 if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) > current_time && length < 96) 699 if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) < current_time && length < 96)
700 || data[0] == NET_PACKET_COOKIE_REQUEST || data[0] == NET_PACKET_CRYPTO_HS) { 700 || data[0] == NET_PACKET_COOKIE_REQUEST || data[0] == NET_PACKET_CRYPTO_HS) {
701 if ((uint32_t)sendpacket(dht_get_net(c->dht), ip_port, data, length) == length) { 701 if ((uint32_t)sendpacket(dht_get_net(c->dht), ip_port, data, length) == length) {
702 direct_send_attempt = 1; 702 direct_send_attempt = 1;