mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed small issues in onion.c
This commit is contained in:
parent
9c9e3b0e45
commit
5341801bf1
@ -127,7 +127,7 @@ static int handle_send_initial(void *object, IP_Port source, uint8_t *packet, ui
|
||||
if (len != sizeof(IP_Port) + crypto_secretbox_MACBYTES)
|
||||
return 1;
|
||||
|
||||
data_len += len;
|
||||
data_len += crypto_secretbox_NONCEBYTES + len;
|
||||
|
||||
if ((uint32_t)sendpacket(onion->net, send_to, data, data_len) != data_len)
|
||||
return 1;
|
||||
@ -172,7 +172,7 @@ static int handle_send_1(void *object, IP_Port source, uint8_t *packet, uint32_t
|
||||
if (len != RETURN_2 - crypto_secretbox_NONCEBYTES)
|
||||
return 1;
|
||||
|
||||
data_len += len;
|
||||
data_len += crypto_secretbox_NONCEBYTES + len;
|
||||
|
||||
if ((uint32_t)sendpacket(onion->net, send_to, data, data_len) != data_len)
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user