Skip to content

Commit

Permalink
DHT_bootstrap.c now has TCP server functionality enabled.
Browse files Browse the repository at this point in the history
Fixed a regression (same type as last commit).
  • Loading branch information
irungentoo committed Apr 16, 2014
1 parent be413de commit 6578d93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions other/DHT_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions toxcore/onion_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6578d93

Please sign in to comment.