diff options
author | mannol <eniz_vukovic@hotmail.com> | 2014-04-27 19:21:26 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2014-04-27 19:21:26 +0200 |
commit | 42b25a4d3e2fe66f03cbd8c866d8af7bd4f6e5a7 (patch) | |
tree | 161a21847a79f7fe052a9e9ad1b9b802d04defc6 /toxcore/Messenger.c | |
parent | 736f5f80347a39f6b82cda8a4ddc1f7d88fcc2f5 (diff) |
Yeah many calls
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index db5390c0..2033e6a9 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "config.h" | 25 | #include "config.h" |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include "logger.h" | ||
28 | #include "Messenger.h" | 29 | #include "Messenger.h" |
29 | #include "assoc.h" | 30 | #include "assoc.h" |
30 | #include "network.h" | 31 | #include "network.h" |
@@ -2245,7 +2246,7 @@ void do_messenger(Messenger *m) | |||
2245 | #ifdef LOGGING | 2246 | #ifdef LOGGING |
2246 | 2247 | ||
2247 | if (unix_time() > lastdump + DUMPING_CLIENTS_FRIENDS_EVERY_N_SECONDS) { | 2248 | if (unix_time() > lastdump + DUMPING_CLIENTS_FRIENDS_EVERY_N_SECONDS) { |
2248 | loglog(" = = = = = = = = \n"); | 2249 | |
2249 | #ifdef ENABLE_ASSOC_DHT | 2250 | #ifdef ENABLE_ASSOC_DHT |
2250 | Assoc_status(m->dht->assoc); | 2251 | Assoc_status(m->dht->assoc); |
2251 | #endif | 2252 | #endif |
@@ -2254,12 +2255,10 @@ void do_messenger(Messenger *m) | |||
2254 | size_t c; | 2255 | size_t c; |
2255 | 2256 | ||
2256 | for (c = 0; c < m->numchats; c++) { | 2257 | for (c = 0; c < m->numchats; c++) { |
2257 | loglog("---------------- \n"); | ||
2258 | Assoc_status(m->chats[c]->assoc); | 2258 | Assoc_status(m->chats[c]->assoc); |
2259 | } | 2259 | } |
2260 | } | 2260 | } |
2261 | 2261 | ||
2262 | loglog(" = = = = = = = = \n"); | ||
2263 | 2262 | ||
2264 | lastdump = unix_time(); | 2263 | lastdump = unix_time(); |
2265 | uint32_t client, last_pinged; | 2264 | uint32_t client, last_pinged; |
@@ -2276,14 +2275,12 @@ void do_messenger(Messenger *m) | |||
2276 | if (last_pinged > 999) | 2275 | if (last_pinged > 999) |
2277 | last_pinged = 999; | 2276 | last_pinged = 999; |
2278 | 2277 | ||
2279 | snprintf(logbuffer, sizeof(logbuffer), "C[%2u] %s:%u [%3u] %s\n", | 2278 | LOGGER_DEBUG("C[%2u] %s:%u [%3u] %s", |
2280 | client, ip_ntoa(&assoc->ip_port.ip), ntohs(assoc->ip_port.port), | 2279 | client, ip_ntoa(&assoc->ip_port.ip), ntohs(assoc->ip_port.port), |
2281 | last_pinged, ID2String(cptr->client_id)); | 2280 | last_pinged, ID2String(cptr->client_id)); |
2282 | loglog(logbuffer); | ||
2283 | } | 2281 | } |
2284 | } | 2282 | } |
2285 | 2283 | ||
2286 | loglog(" = = = = = = = = \n"); | ||
2287 | 2284 | ||
2288 | uint32_t friend, dhtfriend; | 2285 | uint32_t friend, dhtfriend; |
2289 | 2286 | ||
@@ -2311,9 +2308,7 @@ void do_messenger(Messenger *m) | |||
2311 | dht2m[m2dht[friend]] = friend; | 2308 | dht2m[m2dht[friend]] = friend; |
2312 | 2309 | ||
2313 | if (m->numfriends != m->dht->num_friends) { | 2310 | if (m->numfriends != m->dht->num_friends) { |
2314 | sprintf(logbuffer, "Friend num in DHT %u != friend num in msger %u\n", | 2311 | LOGGER_DEBUG("Friend num in DHT %u != friend num in msger %u\n", m->dht->num_friends, m->numfriends); |
2315 | m->dht->num_friends, m->numfriends); | ||
2316 | loglog(logbuffer); | ||
2317 | } | 2312 | } |
2318 | 2313 | ||
2319 | uint32_t ping_lastrecv; | 2314 | uint32_t ping_lastrecv; |
@@ -2334,14 +2329,11 @@ void do_messenger(Messenger *m) | |||
2334 | if (ping_lastrecv > 999) | 2329 | if (ping_lastrecv > 999) |
2335 | ping_lastrecv = 999; | 2330 | ping_lastrecv = 999; |
2336 | 2331 | ||
2337 | snprintf(logbuffer, sizeof(logbuffer), "F[%2u:%2u] <%s> %02i [%03u] %s\n", | 2332 | LOGGER_DEBUG("F[%2u:%2u] <%s> %02i [%03u] %s", |
2338 | dht2m[friend], friend, msgfptr->name, msgfptr->crypt_connection_id, | 2333 | dht2m[friend], friend, msgfptr->name, msgfptr->crypt_connection_id, |
2339 | ping_lastrecv, ID2String(msgfptr->client_id)); | 2334 | ping_lastrecv, ID2String(msgfptr->client_id)); |
2340 | loglog(logbuffer); | ||
2341 | } else { | 2335 | } else { |
2342 | snprintf(logbuffer, sizeof(logbuffer), "F[--:%2u] %s\n", | 2336 | LOGGER_DEBUG("F[--:%2u] %s", friend, ID2String(dhtfptr->client_id)); |
2343 | friend, ID2String(dhtfptr->client_id)); | ||
2344 | loglog(logbuffer); | ||
2345 | } | 2337 | } |
2346 | 2338 | ||
2347 | for (client = 0; client < MAX_FRIEND_CLIENTS; client++) { | 2339 | for (client = 0; client < MAX_FRIEND_CLIENTS; client++) { |
@@ -2355,20 +2347,16 @@ void do_messenger(Messenger *m) | |||
2355 | 2347 | ||
2356 | if (last_pinged > 999) | 2348 | if (last_pinged > 999) |
2357 | last_pinged = 999; | 2349 | last_pinged = 999; |
2358 | 2350 | ||
2359 | snprintf(logbuffer, sizeof(logbuffer), "F[%2u] => C[%2u] %s:%u [%3u] %s\n", | 2351 | LOGGER_DEBUG("F[%2u] => C[%2u] %s:%u [%3u] %s", |
2360 | friend, client, ip_ntoa(&assoc->ip_port.ip), | 2352 | friend, client, ip_ntoa(&assoc->ip_port.ip), |
2361 | ntohs(assoc->ip_port.port), last_pinged, | 2353 | ntohs(assoc->ip_port.port), last_pinged, |
2362 | ID2String(cptr->client_id)); | 2354 | ID2String(cptr->client_id)); |
2363 | loglog(logbuffer); | ||
2364 | } | 2355 | } |
2365 | } | 2356 | } |
2366 | } | 2357 | } |
2367 | |||
2368 | loglog(" = = = = = = = = \n"); | ||
2369 | } | 2358 | } |
2370 | 2359 | #endif /* LOGGING */ | |
2371 | #endif | ||
2372 | } | 2360 | } |
2373 | 2361 | ||
2374 | /* | 2362 | /* |