summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authorzugz (tox) <mbays+tox@sdf.org>2018-09-09 23:21:20 +0200
committerzugz (tox) <mbays+tox@sdf.org>2018-10-20 11:03:10 +0200
commit744dc2f5da2c54ad1e4d7d6ce229bc1756d81263 (patch)
tree35f6590fe3150118bc6b1336fbb0a7db06543668 /toxcore/DHT.c
parentaa5c7828802b3fcaedfd8d6fe9a08ca714b9aa2b (diff)
Make saving and loading the responsibility of Tox rather than Messenger
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 8208052d..4908de32 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -2831,7 +2831,7 @@ uint32_t dht_size(const DHT *dht)
2831/* Save the DHT in data where data is an array of size dht_size(). */ 2831/* Save the DHT in data where data is an array of size dht_size(). */
2832void dht_save(const DHT *dht, uint8_t *data) 2832void dht_save(const DHT *dht, uint8_t *data)
2833{ 2833{
2834 host_to_lendian32(data, DHT_STATE_COOKIE_GLOBAL); 2834 host_to_lendian_bytes32(data, DHT_STATE_COOKIE_GLOBAL);
2835 data += sizeof(uint32_t); 2835 data += sizeof(uint32_t);
2836 2836
2837 uint8_t *const old_data = data; 2837 uint8_t *const old_data = data;
@@ -2960,7 +2960,7 @@ int dht_load(DHT *dht, const uint8_t *data, uint32_t length)
2960 2960
2961 if (length > cookie_len) { 2961 if (length > cookie_len) {
2962 uint32_t data32; 2962 uint32_t data32;
2963 lendian_to_host32(&data32, data); 2963 lendian_bytes_to_host32(&data32, data);
2964 2964
2965 if (data32 == DHT_STATE_COOKIE_GLOBAL) { 2965 if (data32 == DHT_STATE_COOKIE_GLOBAL) {
2966 return state_load(dht->log, dht_load_state_callback, dht, data + cookie_len, 2966 return state_load(dht->log, dht_load_state_callback, dht, data + cookie_len,