From 643eea60bb9dcf4ecb33d64666b1bc77cbfd7438 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 15 Jan 2018 01:23:08 +0000 Subject: Make DHT a module-private type. --- toxcore/onion_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toxcore/onion_client.c') diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index f7ff41bd..c652d7f3 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -1133,7 +1133,7 @@ static int send_dht_dhtpk(const Onion_Client *onion_c, int friend_num, const uin } uint8_t packet[MAX_CRYPTO_REQUEST_SIZE]; - len = create_request(onion_c->dht->self_public_key, onion_c->dht->self_secret_key, packet, + len = create_request(dht_get_self_public_key(onion_c->dht), dht_get_self_secret_key(onion_c->dht), packet, onion_c->friends_list[friend_num].dht_public_key, temp, SIZEOF_VLA(temp), CRYPTO_PACKET_DHTPK); if (len == -1) { @@ -1192,7 +1192,7 @@ static int send_dhtpk_announce(Onion_Client *onion_c, uint16_t friend_num, uint8 uint64_t no_replay = unix_time(); host_to_net((uint8_t *)&no_replay, sizeof(no_replay)); memcpy(data + 1, &no_replay, sizeof(no_replay)); - memcpy(data + 1 + sizeof(uint64_t), onion_c->dht->self_public_key, CRYPTO_PUBLIC_KEY_SIZE); + memcpy(data + 1 + sizeof(uint64_t), dht_get_self_public_key(onion_c->dht), CRYPTO_PUBLIC_KEY_SIZE); Node_format nodes[MAX_SENT_NODES]; uint16_t num_relays = copy_connected_tcp_relays(onion_c->c, nodes, (MAX_SENT_NODES / 2)); uint16_t num_nodes = closelist_nodes(onion_c->dht, &nodes[num_relays], MAX_SENT_NODES - num_relays); @@ -1864,7 +1864,7 @@ Onion_Client *new_onion_client(Net_Crypto *c) } onion_c->dht = nc_get_dht(c); - onion_c->net = onion_c->dht->net; + onion_c->net = dht_get_net(onion_c->dht); onion_c->c = c; new_symmetric_key(onion_c->secret_symmetric_key); crypto_new_keypair(onion_c->temp_public_key, onion_c->temp_secret_key); -- cgit v1.2.3