mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
DHT_bootstrap.c now has TCP server functionality enabled.
Fixed a regression (same type as last commit).
This commit is contained in:
parent
be413de396
commit
6578d930f8
@ -31,6 +31,8 @@
|
||||
#include "../toxcore/friend_requests.h"
|
||||
#include "../toxcore/util.h"
|
||||
|
||||
#define TCP_RELAY_ENABLED
|
||||
|
||||
#ifdef TCP_RELAY_ENABLED
|
||||
#include "../toxcore/TCP_server.h"
|
||||
#endif
|
||||
|
@ -660,11 +660,16 @@ static int send_fakeid_announce(Onion_Client *onion_c, uint16_t friend_num, uint
|
||||
memcpy(data + 1 + sizeof(uint64_t), onion_c->dht->self_public_key, crypto_box_PUBLICKEYBYTES);
|
||||
Node_format nodes[MAX_SENT_NODES];
|
||||
uint16_t num_nodes = closelist_nodes(onion_c->dht, nodes, MAX_SENT_NODES);
|
||||
int nodes_len = pack_nodes(data + FAKEID_DATA_MIN_LENGTH, FAKEID_DATA_MAX_LENGTH - FAKEID_DATA_MIN_LENGTH, nodes,
|
||||
|
||||
int nodes_len = 0;
|
||||
|
||||
if (num_nodes != 0) {
|
||||
nodes_len = pack_nodes(data + FAKEID_DATA_MIN_LENGTH, FAKEID_DATA_MAX_LENGTH - FAKEID_DATA_MIN_LENGTH, nodes,
|
||||
num_nodes);
|
||||
|
||||
if (nodes_len <= 0)
|
||||
return -1;
|
||||
if (nodes_len <= 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int num1 = -1, num2 = -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user