summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/TCP_server.c')
-rw-r--r--toxcore/TCP_server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index 7487ad4f..6c0133dd 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -335,16 +335,16 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const
335 if ((unsigned int)len != (sizeof(packet) - sizeof(uint16_t))) 335 if ((unsigned int)len != (sizeof(packet) - sizeof(uint16_t)))
336 return -1; 336 return -1;
337 337
338 increment_nonce(con->sent_nonce);
339
340 len = send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL); 338 len = send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL);
341 339
342 if ((unsigned int)len == sizeof(packet))
343 return 1;
344
345 if (len <= 0) 340 if (len <= 0)
346 return 0; 341 return 0;
347 342
343 increment_nonce(con->sent_nonce);
344
345 if ((unsigned int)len == sizeof(packet))
346 return 1;
347
348 memcpy(con->last_packet, packet, length); 348 memcpy(con->last_packet, packet, length);
349 con->last_packet_length = sizeof(packet); 349 con->last_packet_length = sizeof(packet);
350 con->last_packet_sent = len; 350 con->last_packet_sent = len;