summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-28 20:50:54 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-28 20:50:54 -0400
commitaae9fae257bb3948a1c5d51f939b25516b54c3ff (patch)
treefbd0dd42d3998c3fdca5d840fd5910a144c11ae7 /toxcore/net_crypto.c
parentd4e42230bdce38941abad85ba2aaa184f31e2f5f (diff)
Fixed possible problem.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r--toxcore/net_crypto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index b82a1e6d..9a840d11 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -508,8 +508,7 @@ int crypto_inbound(Net_Crypto *c, uint8_t *public_key, uint8_t *secret_nonce, ui
508 int incoming_con = incoming_connection(c->lossless_udp, 1); 508 int incoming_con = incoming_connection(c->lossless_udp, 1);
509 509
510 if (incoming_con != -1) { 510 if (incoming_con != -1) {
511 if (is_connected(c->lossless_udp, incoming_con) == 4 511 if (is_connected(c->lossless_udp, incoming_con) == 4) {
512 || is_connected(c->lossless_udp, incoming_con) == 0) {
513 kill_connection(c->lossless_udp, incoming_con); 512 kill_connection(c->lossless_udp, incoming_con);
514 continue; 513 continue;
515 } 514 }
@@ -671,6 +670,9 @@ static void receive_crypto(Net_Crypto *c)
671 uint64_t temp_time = unix_time(); 670 uint64_t temp_time = unix_time();
672 671
673 for (i = 0; i < c->crypto_connections_length; ++i) { 672 for (i = 0; i < c->crypto_connections_length; ++i) {
673 if (c->crypto_connections[i].status == CONN_NO_CONNECTION)
674 continue;
675
674 if (c->crypto_connections[i].status == CONN_HANDSHAKE_SENT) { 676 if (c->crypto_connections[i].status == CONN_HANDSHAKE_SENT) {
675 uint8_t temp_data[MAX_DATA_SIZE]; 677 uint8_t temp_data[MAX_DATA_SIZE];
676 uint8_t secret_nonce[crypto_box_NONCEBYTES]; 678 uint8_t secret_nonce[crypto_box_NONCEBYTES];