diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-06-23 17:16:28 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-06-24 19:17:32 +0000 |
commit | 8e00294b3cb9808ce55160240454359638178275 (patch) | |
tree | 095a7708b3fe3566951ebe7b068ee66a8beed3c1 /toxcore/DHT.c | |
parent | 5a8790eab0ed9421445adce40526462b9e6742c3 (diff) |
Add Logger to various net_crypto functions.
In preparation for adding log statements.
Also, fix an uninitialised variable warning in cppcheck.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 6134f59b..bb996e2d 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -85,7 +85,7 @@ struct DHT_Friend { | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct DHT { | 87 | struct DHT { |
88 | Logger *log; | 88 | const Logger *log; |
89 | Networking_Core *net; | 89 | Networking_Core *net; |
90 | 90 | ||
91 | bool hole_punching_enabled; | 91 | bool hole_punching_enabled; |
@@ -658,7 +658,7 @@ static uint32_t index_of_client_ip_port(const Client_data *array, uint32_t size, | |||
658 | 658 | ||
659 | /* Update ip_port of client if it's needed. | 659 | /* Update ip_port of client if it's needed. |
660 | */ | 660 | */ |
661 | static void update_client(Logger *log, int index, Client_data *client, IP_Port ip_port) | 661 | static void update_client(const Logger *log, int index, Client_data *client, IP_Port ip_port) |
662 | { | 662 | { |
663 | IPPTsPng *assoc; | 663 | IPPTsPng *assoc; |
664 | int ip_version; | 664 | int ip_version; |
@@ -698,7 +698,7 @@ static void update_client(Logger *log, int index, Client_data *client, IP_Port i | |||
698 | * | 698 | * |
699 | * return True(1) or False(0) | 699 | * return True(1) or False(0) |
700 | */ | 700 | */ |
701 | static int client_or_ip_port_in_list(Logger *log, Client_data *list, uint16_t length, const uint8_t *public_key, | 701 | static int client_or_ip_port_in_list(const Logger *log, Client_data *list, uint16_t length, const uint8_t *public_key, |
702 | IP_Port ip_port) | 702 | IP_Port ip_port) |
703 | { | 703 | { |
704 | const uint64_t temp_time = unix_time(); | 704 | const uint64_t temp_time = unix_time(); |
@@ -2673,7 +2673,7 @@ static int cryptopacket_handle(void *object, IP_Port source, const uint8_t *pack | |||
2673 | 2673 | ||
2674 | /*----------------------------------------------------------------------------------*/ | 2674 | /*----------------------------------------------------------------------------------*/ |
2675 | 2675 | ||
2676 | DHT *new_DHT(Logger *log, Networking_Core *net, bool holepunching_enabled) | 2676 | DHT *new_DHT(const Logger *log, Networking_Core *net, bool holepunching_enabled) |
2677 | { | 2677 | { |
2678 | /* init time */ | 2678 | /* init time */ |
2679 | unix_time_update(); | 2679 | unix_time_update(); |