summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-07-16 20:39:58 -0400
committerirungentoo <irungentoo@gmail.com>2014-07-16 20:39:58 -0400
commitbcfb1261ac4ab5f6470924f473c8c18bc5f98f01 (patch)
tree6e9c800830bb8a6d8df8534c01e86babf3e1b92d /toxcore
parent1e69af8cff35fa1455a861130a2f936563b2c2ad (diff)
Fixed possible bug with TCP nonce not getting incremented.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/TCP_client.c4
-rw-r--r--toxcore/TCP_server.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c
index 02d4e7dc..45220538 100644
--- a/toxcore/TCP_client.c
+++ b/toxcore/TCP_client.c
@@ -231,10 +231,10 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const
231 231
232 if (len <= 0) { 232 if (len <= 0) {
233 len = 0; 233 len = 0;
234 } else {
235 increment_nonce(con->sent_nonce);
236 } 234 }
237 235
236 increment_nonce(con->sent_nonce);
237
238 if (len == sizeof(packet)) { 238 if (len == sizeof(packet)) {
239 return 1; 239 return 1;
240 } 240 }
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index f3cdd287..47e2ff27 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -411,10 +411,10 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const
411 411
412 if (len <= 0) { 412 if (len <= 0) {
413 len = 0; 413 len = 0;
414 } else {
415 increment_nonce(con->sent_nonce);
416 } 414 }
417 415
416 increment_nonce(con->sent_nonce);
417
418 if (len == sizeof(packet)) { 418 if (len == sizeof(packet)) {
419 return 1; 419 return 1;
420 } 420 }