From db0438644c2ad85719ed0866d85cd3df9a71300b Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 22 Apr 2015 09:10:57 -0400 Subject: [PATCH] Fixed possible issue. --- toxcore/TCP_connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toxcore/TCP_connection.c b/toxcore/TCP_connection.c index 08cb728c..26b35a92 100644 --- a/toxcore/TCP_connection.c +++ b/toxcore/TCP_connection.c @@ -830,8 +830,6 @@ static int tcp_response_callback(void *object, uint8_t connection_id, const uint if (connections_number == -1) return -1; - set_tcp_connection_number(tcp_con->connection, connection_id, connections_number); - TCP_Connection_to *con_to = get_connection(tcp_c, connections_number); if (con_to == NULL) @@ -840,6 +838,8 @@ static int tcp_response_callback(void *object, uint8_t connection_id, const uint if (set_tcp_connection_status(con_to, tcp_connections_number, TCP_CONNECTIONS_STATUS_REGISTERED, connection_id) == -1) return -1; + set_tcp_connection_number(tcp_con->connection, connection_id, connections_number); + return 0; }