diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-02-19 14:46:43 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-03-16 02:07:39 +0000 |
commit | fa8927aa0f90be1b15ef1d059c6f2ce81e2be8f5 (patch) | |
tree | 6de00f42ff8095d6736db4dc239f3476347972c1 /toxcore/Messenger.c | |
parent | aa050954195f6323775ed68f4262edf2341c6953 (diff) |
Move struct DHT_Friend into DHT.c.
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 6e209f4d..4a24ae5f 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -2702,15 +2702,16 @@ void do_messenger(Messenger *m, void *userdata) | |||
2702 | } else { | 2702 | } else { |
2703 | char id_str[IDSTRING_LEN]; | 2703 | char id_str[IDSTRING_LEN]; |
2704 | LOGGER_TRACE(m->log, "F[--:%2u] %s", friend_idx, | 2704 | LOGGER_TRACE(m->log, "F[--:%2u] %s", friend_idx, |
2705 | id_to_string(dhtfptr->public_key, id_str, sizeof(id_str))); | 2705 | id_to_string(dht_friend_public_key(dhtfptr), id_str, sizeof(id_str))); |
2706 | } | 2706 | } |
2707 | 2707 | ||
2708 | for (client = 0; client < MAX_FRIEND_CLIENTS; client++) { | 2708 | for (client = 0; client < MAX_FRIEND_CLIENTS; client++) { |
2709 | Client_data *cptr = &dhtfptr->client_list[client]; | 2709 | const Client_data *cptr = dht_friend_client(dhtfptr, client); |
2710 | IPPTsPng *assoc = nullptr; | 2710 | const IPPTsPng *const assocs[] = {&cptr->assoc4, &cptr->assoc6}; |
2711 | uint32_t a; | 2711 | |
2712 | for (size_t a = 0; a < sizeof(assocs) / sizeof(assocs[0]); a++) { | ||
2713 | const IPPTsPng *const assoc = assocs[a]; | ||
2712 | 2714 | ||
2713 | for (a = 0, assoc = &cptr->assoc4; a < 2; a++, assoc = &cptr->assoc6) { | ||
2714 | if (ip_isset(&assoc->ip_port.ip)) { | 2715 | if (ip_isset(&assoc->ip_port.ip)) { |
2715 | last_pinged = m->lastdump - assoc->last_pinged; | 2716 | last_pinged = m->lastdump - assoc->last_pinged; |
2716 | 2717 | ||