diff options
author | irungentoo <irungentoo@gmail.com> | 2013-09-25 13:19:19 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-09-25 13:19:19 -0400 |
commit | beff2b6de659a708ed366a9ae925eab8c4ca0ddd (patch) | |
tree | b320705993d7cc67169436bb94a9ed738eb05d98 /toxcore/net_crypto.c | |
parent | 3c78aefce07cf83a5236b0fcdb202ff463ff6a60 (diff) |
Possible bug fixed.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 98571ce7..744bc754 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -694,9 +694,8 @@ static void receive_crypto(Net_Crypto *c) | |||
694 | } | 694 | } |
695 | } | 695 | } |
696 | } else if (id_packet(c->lossless_udp, | 696 | } else if (id_packet(c->lossless_udp, |
697 | c->crypto_connections[i].number) != -1) { // This should not happen, kill the connection if it does. | 697 | c->crypto_connections[i].number) != -1) { // This should not happen, timeout the connection if it does. |
698 | crypto_kill(c, i); | 698 | c->crypto_connections[i].status = CONN_TIMED_OUT; |
699 | return; | ||
700 | } | 699 | } |
701 | } | 700 | } |
702 | 701 | ||
@@ -717,14 +716,12 @@ static void receive_crypto(Net_Crypto *c) | |||
717 | c->crypto_connections[i].shared_key); | 716 | c->crypto_connections[i].shared_key); |
718 | c->crypto_connections[i].status = CONN_ESTABLISHED; | 717 | c->crypto_connections[i].status = CONN_ESTABLISHED; |
719 | } else { | 718 | } else { |
720 | /* This should not happen, kill the connection if it does. */ | 719 | /* This should not happen, timeout the connection if it does. */ |
721 | crypto_kill(c, i); | 720 | c->crypto_connections[i].status = CONN_TIMED_OUT; |
722 | return; | ||
723 | } | 721 | } |
724 | } else if (id_packet(c->lossless_udp, c->crypto_connections[i].number) != -1) { | 722 | } else if (id_packet(c->lossless_udp, c->crypto_connections[i].number) != -1) { |
725 | /* This should not happen, kill the connection if it does. */ | 723 | /* This should not happen, timeout the connection if it does. */ |
726 | crypto_kill(c, i); | 724 | c->crypto_connections[i].status = CONN_TIMED_OUT; |
727 | return; | ||
728 | } | 725 | } |
729 | } | 726 | } |
730 | } | 727 | } |