DHT_bootstrap.c now has TCP server functionality enabled.

Fixed a regression (same type as last commit).
This commit is contained in:
irungentoo 2014-04-16 07:19:40 -04:00
parent be413de396
commit 6578d930f8
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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;