mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Don't set connection to established if packet is kill packet.
Removed now useless defines in network.h
This commit is contained in:
parent
b63e4ad88f
commit
8d15ccc347
|
@ -1094,6 +1094,11 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (real_data[0] == PACKET_ID_KILL) {
|
||||||
|
conn->killed = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) {
|
if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) {
|
||||||
clear_temp_packet(c, crypt_connection_id);
|
clear_temp_packet(c, crypt_connection_id);
|
||||||
conn->status = CRYPTO_CONN_ESTABLISHED;
|
conn->status = CRYPTO_CONN_ESTABLISHED;
|
||||||
|
@ -1112,9 +1117,6 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i
|
||||||
}
|
}
|
||||||
|
|
||||||
set_buffer_end(&conn->recv_array, num);
|
set_buffer_end(&conn->recv_array, num);
|
||||||
} else if (real_data[0] == PACKET_ID_KILL) {
|
|
||||||
conn->killed = 1;
|
|
||||||
return 0;
|
|
||||||
} else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) {
|
} else if (real_data[0] >= CRYPTO_RESERVED_PACKETS && real_data[0] < PACKET_ID_LOSSY_RANGE_START) {
|
||||||
Packet_Data dt;
|
Packet_Data dt;
|
||||||
dt.time = current_time_monotonic();
|
dt.time = current_time_monotonic();
|
||||||
|
|
|
@ -99,9 +99,6 @@ typedef int sock_t;
|
||||||
#define NET_PACKET_GET_NODES 2 /* Get nodes request packet ID. */
|
#define NET_PACKET_GET_NODES 2 /* Get nodes request packet ID. */
|
||||||
#define NET_PACKET_SEND_NODES 3 /* Send nodes response packet ID for IPv4 addresses. */
|
#define NET_PACKET_SEND_NODES 3 /* Send nodes response packet ID for IPv4 addresses. */
|
||||||
#define NET_PACKET_SEND_NODES_IPV6 4 /* Send nodes response packet ID for other addresses. */
|
#define NET_PACKET_SEND_NODES_IPV6 4 /* Send nodes response packet ID for other addresses. */
|
||||||
#define NET_PACKET_HANDSHAKE 16 /* Handshake packet ID. */
|
|
||||||
#define NET_PACKET_SYNC 17 /* SYNC packet ID. */
|
|
||||||
#define NET_PACKET_DATA 18 /* Data packet ID. */
|
|
||||||
#define NET_PACKET_COOKIE_REQUEST 24 /* Cookie request packet */
|
#define NET_PACKET_COOKIE_REQUEST 24 /* Cookie request packet */
|
||||||
#define NET_PACKET_COOKIE_RESPONSE 25 /* Cookie response packet */
|
#define NET_PACKET_COOKIE_RESPONSE 25 /* Cookie response packet */
|
||||||
#define NET_PACKET_CRYPTO_HS 26 /* Crypto handshake packet */
|
#define NET_PACKET_CRYPTO_HS 26 /* Crypto handshake packet */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user