From 2c989d992ce77086f7acb70ceb95bae58378ca1d Mon Sep 17 00:00:00 2001 From: isotoxin Date: Sat, 3 Sep 2016 21:26:45 +0300 Subject: [PATCH] Rearrange fields to decrease size of structure --- toxcore/TCP_server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h index 908916ef..f5768594 100644 --- a/toxcore/TCP_server.h +++ b/toxcore/TCP_server.h @@ -89,7 +89,6 @@ struct TCP_Priority_List { }; typedef struct TCP_Secure_Connection { - uint8_t status; sock_t sock; uint8_t public_key[crypto_box_PUBLICKEYBYTES]; uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ @@ -97,12 +96,13 @@ typedef struct TCP_Secure_Connection { uint8_t shared_key[crypto_box_BEFORENMBYTES]; uint16_t next_packet_length; struct { - uint8_t status; /* 0 if not used, 1 if other is offline, 2 if other is online. */ uint8_t public_key[crypto_box_PUBLICKEYBYTES]; uint32_t index; + uint8_t status; /* 0 if not used, 1 if other is offline, 2 if other is online. */ uint8_t other_id; } connections[NUM_CLIENT_CONNECTIONS]; uint8_t last_packet[2 + MAX_PACKET_SIZE]; + uint8_t status; uint16_t last_packet_length; uint16_t last_packet_sent;