Skip to content

Commit

Permalink
fix typo: now we periodically try to send direct packets when connect…
Browse files Browse the repository at this point in the history
…ed by tcp
  • Loading branch information
zugz authored and iphydf committed Mar 22, 2020
1 parent ba95314 commit da93f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toxcore/net_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static int send_packet_to(Net_Crypto *c, int crypt_connection_id, const uint8_t
// TODO(irungentoo): a better way of sending packets directly to confirm the others ip.
const uint64_t current_time = mono_time_get(c->mono_time);

if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) > current_time && length < 96)
if ((((UDP_DIRECT_TIMEOUT / 2) + conn->direct_send_attempt_time) < current_time && length < 96)
|| data[0] == NET_PACKET_COOKIE_REQUEST || data[0] == NET_PACKET_CRYPTO_HS) {
if ((uint32_t)sendpacket(dht_get_net(c->dht), ip_port, data, length) == length) {
direct_send_attempt = 1;
Expand Down

0 comments on commit da93f05

Please sign in to comment.