summaryrefslogtreecommitdiff
path: root/other/bootstrap_serverdaemon
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2014-01-20 14:11:30 -0500
committerMaxim Biro <nurupo.contributions@gmail.com>2014-01-20 14:19:11 -0500
commit96767c170a517ad676f2e9cf29082c34d30d6287 (patch)
tree5773cc5969fce7001387888f530be6bba24d0588 /other/bootstrap_serverdaemon
parentb67d6bd024de4816843a95c74ee903242af44423 (diff)
Moved things around
Diffstat (limited to 'other/bootstrap_serverdaemon')
-rw-r--r--other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c b/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c
index 77003e35..24bb8266 100644
--- a/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c
+++ b/other/bootstrap_serverdaemon/tox_dht_bootstrap_server_daemon.c
@@ -92,6 +92,10 @@ int manage_keys(DHT *dht, char *keys_file_path)
92 92
93 fclose(keys_file); 93 fclose(keys_file);
94 94
95 // We want our DHT public key to be the same as our internal one since this is a bootstrap server
96 memcpy(dht->self_public_key, dht->c->self_public_key, crypto_box_PUBLICKEYBYTES);
97 memcpy(dht->self_secret_key, dht->c->self_secret_key, crypto_box_SECRETKEYBYTES);
98
95 return 1; 99 return 1;
96} 100}
97 101
@@ -359,16 +363,17 @@ int main(int argc, char *argv[])
359 ip_init(&ip, enable_ipv6); 363 ip_init(&ip, enable_ipv6);
360 364
361 DHT *dht = new_DHT(new_net_crypto(new_networking(ip, port))); 365 DHT *dht = new_DHT(new_net_crypto(new_networking(ip, port)));
362 Onion *onion = new_onion(dht);
363 Onion_Announce *onion_a = new_onion_announce(dht);
364 366
365 if (dht == NULL) { 367 if (dht == NULL) {
366 syslog(LOG_ERR, "Couldn't initialize Tox DHT instance. Exiting.\n"); 368 syslog(LOG_ERR, "Couldn't initialize Tox DHT instance. Exiting.\n");
367 return 1; 369 return 1;
368 } 370 }
369 371
372 Onion *onion = new_onion(dht);
373 Onion_Announce *onion_a = new_onion_announce(dht);
374
370 if (!(onion && onion_a)) { 375 if (!(onion && onion_a)) {
371 syslog(LOG_ERR, "Couldn't initialize Tox onion stuff. Exiting.\n"); 376 syslog(LOG_ERR, "Couldn't initialize Tox Onion. Exiting.\n");
372 return 1; 377 return 1;
373 } 378 }
374 379
@@ -383,10 +388,6 @@ int main(int argc, char *argv[])
383 return 1; 388 return 1;
384 } 389 }
385 390
386 /* We want our DHT public key to be the same as our internal one since this is a bootstrap server */
387 memcpy(dht->self_public_key, dht->c->self_public_key, crypto_box_PUBLICKEYBYTES);
388 memcpy(dht->self_secret_key, dht->c->self_secret_key, crypto_box_SECRETKEYBYTES);
389
390 if (bootstrap_from_config(cfg_file_path, dht, enable_ipv6)) { 391 if (bootstrap_from_config(cfg_file_path, dht, enable_ipv6)) {
391 syslog(LOG_DEBUG, "List of bootstrap servers read successfully\n"); 392 syslog(LOG_DEBUG, "List of bootstrap servers read successfully\n");
392 } else { 393 } else {
@@ -424,7 +425,6 @@ int main(int argc, char *argv[])
424 425
425 if (pid > 0) { 426 if (pid > 0) {
426 syslog(LOG_DEBUG, "Forked successfully: PID: %d.\n", pid); 427 syslog(LOG_DEBUG, "Forked successfully: PID: %d.\n", pid);
427
428 return 0; 428 return 0;
429 } 429 }
430 430