diff options
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index ac2359ee..5387065c 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -1094,6 +1094,11 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i | |||
1094 | return -1; | 1094 | return -1; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | if (real_data[0] == PACKET_ID_KILL) { | ||
1098 | conn->killed = 1; | ||
1099 | return 0; | ||
1100 | } | ||
1101 | |||
1097 | if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) { | 1102 | if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) { |
1098 | clear_temp_packet(c, crypt_connection_id); | 1103 | clear_temp_packet(c, crypt_connection_id); |
1099 | conn->status = CRYPTO_CONN_ESTABLISHED; | 1104 | conn->status = CRYPTO_CONN_ESTABLISHED; |
@@ -1112,9 +1117,6 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i | |||
1112 | } | 1117 | } |
1113 | 1118 | ||
1114 | set_buffer_end(&conn->recv_array, num); | 1119 | set_buffer_end(&conn->recv_array, num); |
1115 | } else if (real_data[0] == PACKET_ID_KILL) { | ||
1116 | conn->killed = 1; | ||
1117 | return 0; | ||
1118 | } else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) { | 1120 | } else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) { |
1119 | Packet_Data dt; | 1121 | Packet_Data dt; |
1120 | dt.time = current_time_monotonic(); | 1122 | dt.time = current_time_monotonic(); |