summaryrefslogtreecommitdiff
path: root/toxcore/friend_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/friend_connection.c')
-rw-r--r--toxcore/friend_connection.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/toxcore/friend_connection.c b/toxcore/friend_connection.c
index af5d09e3..fd1fa71c 100644
--- a/toxcore/friend_connection.c
+++ b/toxcore/friend_connection.c
@@ -12,7 +12,6 @@
12 12
13#include "friend_connection.h" 13#include "friend_connection.h"
14 14
15#include <stdio.h>
16#include <stdlib.h> 15#include <stdlib.h>
17#include <string.h> 16#include <string.h>
18 17
@@ -60,6 +59,7 @@ typedef struct Friend_Conn {
60 59
61struct Friend_Connections { 60struct Friend_Connections {
62 const Mono_Time *mono_time; 61 const Mono_Time *mono_time;
62 const Logger *logger;
63 Net_Crypto *net_crypto; 63 Net_Crypto *net_crypto;
64 DHT *dht; 64 DHT *dht;
65 Onion_Client *onion_c; 65 Onion_Client *onion_c;
@@ -348,7 +348,7 @@ static void change_dht_pk(Friend_Connections *fr_c, int friendcon_id, const uint
348 348
349 if (friend_con->dht_lock) { 349 if (friend_con->dht_lock) {
350 if (dht_delfriend(fr_c->dht, friend_con->dht_temp_pk, friend_con->dht_lock) != 0) { 350 if (dht_delfriend(fr_c->dht, friend_con->dht_temp_pk, friend_con->dht_lock) != 0) {
351 printf("a. Could not delete dht peer. Please report this.\n"); 351 LOGGER_ERROR(fr_c->logger, "a. Could not delete dht peer. Please report this.");
352 return; 352 return;
353 } 353 }
354 354
@@ -848,7 +848,7 @@ int send_friend_request_packet(Friend_Connections *fr_c, int friendcon_id, uint3
848} 848}
849 849
850/* Create new friend_connections instance. */ 850/* Create new friend_connections instance. */
851Friend_Connections *new_friend_connections(const Mono_Time *mono_time, Onion_Client *onion_c, 851Friend_Connections *new_friend_connections(const Logger *logger, const Mono_Time *mono_time, Onion_Client *onion_c,
852 bool local_discovery_enabled) 852 bool local_discovery_enabled)
853{ 853{
854 if (onion_c == nullptr) { 854 if (onion_c == nullptr) {
@@ -862,6 +862,7 @@ Friend_Connections *new_friend_connections(const Mono_Time *mono_time, Onion_Cli
862 } 862 }
863 863
864 temp->mono_time = mono_time; 864 temp->mono_time = mono_time;
865 temp->logger = logger;
865 temp->dht = onion_get_dht(onion_c); 866 temp->dht = onion_get_dht(onion_c);
866 temp->net_crypto = onion_get_net_crypto(onion_c); 867 temp->net_crypto = onion_get_net_crypto(onion_c);
867 temp->onion_c = onion_c; 868 temp->onion_c = onion_c;