Change connection status before handling data packets.

This commit is contained in:
irungentoo 2014-07-14 18:20:17 -04:00
parent 2ea634ece2
commit 32ed095d72
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -1106,6 +1106,14 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i
return -1; 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) { if (real_data[0] == PACKET_ID_REQUEST) {
int requested = handle_request_packet(&conn->send_array, real_data, real_length); 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; 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; return 0;
} }