summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2017-01-04 22:37:53 +0000
committeriphydf <iphydf@users.noreply.github.com>2017-01-11 19:43:08 +0000
commit8b4eae4038db87f2df1c40856c99c3ffca8887fe (patch)
treea3d712f2adf081f56a4295a34f5a8c75523e5a18 /toxcore/DHT.c
parent583d71680ec12349cd1bedea72ae136d55667ecb (diff)
Remove `TOX_DEBUG` and have asserts always enabled.
These are cheap asserts. I've also replaced the fprintf's with `LOGGER_ERROR` calls.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 94bbbe01..611cb0f8 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -2813,13 +2813,10 @@ static int dht_load_state_callback(void *outer, const uint8_t *data, uint32_t le
2813 2813
2814 break; 2814 break;
2815 2815
2816#ifdef TOX_DEBUG
2817
2818 default: 2816 default:
2819 fprintf(stderr, "Load state (DHT): contains unrecognized part (len %u, type %u)\n", 2817 LOGGER_ERROR(dht->log, "Load state (DHT): contains unrecognized part (len %u, type %u)\n",
2820 length, type); 2818 length, type);
2821 break; 2819 break;
2822#endif
2823 } 2820 }
2824 2821
2825 return 0; 2822 return 0;
@@ -2839,7 +2836,7 @@ int DHT_load(DHT *dht, const uint8_t *data, uint32_t length)
2839 lendian_to_host32(&data32, data); 2836 lendian_to_host32(&data32, data);
2840 2837
2841 if (data32 == DHT_STATE_COOKIE_GLOBAL) { 2838 if (data32 == DHT_STATE_COOKIE_GLOBAL) {
2842 return load_state(dht_load_state_callback, dht, data + cookie_len, 2839 return load_state(dht_load_state_callback, dht->log, dht, data + cookie_len,
2843 length - cookie_len, DHT_STATE_COOKIE_TYPE); 2840 length - cookie_len, DHT_STATE_COOKIE_TYPE);
2844 } 2841 }
2845 } 2842 }