summaryrefslogtreecommitdiff
path: root/toxcore/friend_connection.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-05-04 08:40:21 -0400
committerirungentoo <irungentoo@gmail.com>2015-05-04 08:40:21 -0400
commit84d4f95038f706458987ac64315e0d9779b4cac7 (patch)
tree219b5a1c33645bac1cf7c0c15a763a88e2e6a495 /toxcore/friend_connection.c
parentd2929881ca9c0058fe126d2e07abceaf70675bf0 (diff)
Fixed possible connection issue.
Diffstat (limited to 'toxcore/friend_connection.c')
-rw-r--r--toxcore/friend_connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/friend_connection.c b/toxcore/friend_connection.c
index c13ca949..de34e570 100644
--- a/toxcore/friend_connection.c
+++ b/toxcore/friend_connection.c
@@ -265,7 +265,7 @@ static void dht_ip_callback(void *object, int32_t number, IP_Port ip_port)
265 friend_new_connection(fr_c, number); 265 friend_new_connection(fr_c, number);
266 } 266 }
267 267
268 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, ip_port); 268 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, ip_port, 1);
269 friend_con->dht_ip_port = ip_port; 269 friend_con->dht_ip_port = ip_port;
270 friend_con->dht_ip_port_lastrecv = unix_time(); 270 friend_con->dht_ip_port_lastrecv = unix_time();
271} 271}
@@ -458,7 +458,7 @@ static int handle_new_connections(void *object, New_Connection *n_c)
458 friend_con->crypt_connection_id = id; 458 friend_con->crypt_connection_id = id;
459 459
460 if (n_c->source.ip.family != AF_INET && n_c->source.ip.family != AF_INET6) { 460 if (n_c->source.ip.family != AF_INET && n_c->source.ip.family != AF_INET6) {
461 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, friend_con->dht_ip_port); 461 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, friend_con->dht_ip_port, 0);
462 } else { 462 } else {
463 friend_con->dht_ip_port = n_c->source; 463 friend_con->dht_ip_port = n_c->source;
464 friend_con->dht_ip_port_lastrecv = unix_time(); 464 friend_con->dht_ip_port_lastrecv = unix_time();
@@ -796,7 +796,7 @@ void do_friend_connections(Friend_Connections *fr_c)
796 796
797 if (friend_con->dht_lock) { 797 if (friend_con->dht_lock) {
798 if (friend_new_connection(fr_c, i) == 0) { 798 if (friend_new_connection(fr_c, i) == 0) {
799 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, friend_con->dht_ip_port); 799 set_direct_ip_port(fr_c->net_crypto, friend_con->crypt_connection_id, friend_con->dht_ip_port, 0);
800 connect_to_saved_tcp_relays(fr_c, i, (MAX_FRIEND_TCP_CONNECTIONS / 2)); /* Only fill it half up. */ 800 connect_to_saved_tcp_relays(fr_c, i, (MAX_FRIEND_TCP_CONNECTIONS / 2)); /* Only fill it half up. */
801 } 801 }
802 } 802 }