mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Change connection status before handling data packets.
This commit is contained in:
parent
2ea634ece2
commit
32ed095d72
|
@ -1106,6 +1106,14 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) {
|
||||
clear_temp_packet(c, crypt_connection_id);
|
||||
conn->status = CRYPTO_CONN_ESTABLISHED;
|
||||
|
||||
if (conn->connection_status_callback)
|
||||
conn->connection_status_callback(conn->connection_status_callback_object, conn->connection_status_callback_id, 1);
|
||||
}
|
||||
|
||||
if (real_data[0] == PACKET_ID_REQUEST) {
|
||||
int requested = handle_request_packet(&conn->send_array, real_data, real_length);
|
||||
|
||||
|
@ -1148,14 +1156,6 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (conn->status == CRYPTO_CONN_NOT_CONFIRMED) {
|
||||
clear_temp_packet(c, crypt_connection_id);
|
||||
conn->status = CRYPTO_CONN_ESTABLISHED;
|
||||
|
||||
if (conn->connection_status_callback)
|
||||
conn->connection_status_callback(conn->connection_status_callback_object, conn->connection_status_callback_id, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user