1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-07 09:56:34 +01:00

Switch to using json DHT nodes file

Parsing json manually like this is ugly, but this allows us to use the json formatted nodeslist file
at nodes.tox.chat instead of having to update the list by hand. We could also potentially
use curl to fetch the list and update it automatically.
This commit is contained in:
Jfreegman
2016-09-17 21:38:32 -04:00
parent 1f02bb2be5
commit 5e20e6b279
5 changed files with 109 additions and 88 deletions

View File

@@ -1,7 +1,7 @@
/* bootstrap.h
*
*
* Copyright (C) 2014 Toxic All Rights Reserved.
* Copyright (C) 2016 Toxic All Rights Reserved.
*
* This file is part of Toxic.
*
@@ -23,10 +23,11 @@
/* Manages connection to the Tox DHT network. */
void do_tox_connection(Tox *m);
/* Load the DHT nodelist to memory.
/* Load the DHT nodelist to memory from json formatted nodes file obtained attempts https://nodes.tox.chat/json.
*
* Return 0 on success.
* Return -1 if nodelist file cannot be opened.
* Return -2 if nodelist file does not contain any valid node entries.
* Return -2 if nodelist file cannot be parsed.
* Return -3 if nodelist file does not contain any valid node entries.
*/
int load_DHT_nodelist(void);