diff options
Diffstat (limited to 'src/gns/gnunet-service-gns.c')
-rw-r--r-- | src/gns/gnunet-service-gns.c | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 2a31e5e61..af5468eba 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -158,7 +158,8 @@ static void | |||
158 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 158 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
159 | { | 159 | { |
160 | /* Kill zone task for it may make the scheduler hang */ | 160 | /* Kill zone task for it may make the scheduler hang */ |
161 | GNUNET_SCHEDULER_cancel(zone_update_taskid); | 161 | if (zone_update_taskid) |
162 | GNUNET_SCHEDULER_cancel(zone_update_taskid); | ||
162 | 163 | ||
163 | GNUNET_DNS_disconnect(dns_handle); | 164 | GNUNET_DNS_disconnect(dns_handle); |
164 | GNUNET_NAMESTORE_disconnect(namestore_handle, 1); | 165 | GNUNET_NAMESTORE_disconnect(namestore_handle, 1); |
@@ -1356,48 +1357,6 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1356 | return; | 1357 | return; |
1357 | } | 1358 | } |
1358 | 1359 | ||
1359 | char* trusted_start; | ||
1360 | char* trusted_name; | ||
1361 | char *trusted_key; | ||
1362 | int trusted_len; | ||
1363 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (c, "gns", | ||
1364 | "TRUSTED", | ||
1365 | &trusted_entities)) | ||
1366 | { | ||
1367 | trusted_start = trusted_entities; | ||
1368 | trusted_len = strlen(trusted_entities); | ||
1369 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
1370 | "Found trusted entities in config file, importing\n"); | ||
1371 | while ((trusted_entities-trusted_start) < trusted_len) | ||
1372 | { | ||
1373 | trusted_name = trusted_entities; | ||
1374 | while (*trusted_entities != ':') | ||
1375 | trusted_entities++; | ||
1376 | *trusted_entities = '\0'; | ||
1377 | trusted_entities++; | ||
1378 | trusted_key = trusted_entities; | ||
1379 | while (*trusted_entities != ',' && (*trusted_entities != '\0')) | ||
1380 | trusted_entities++; | ||
1381 | *trusted_entities = '\0'; | ||
1382 | trusted_entities++; | ||
1383 | |||
1384 | if (GNUNET_YES == GNUNET_DISK_file_test (trusted_key)) | ||
1385 | { | ||
1386 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Adding %s:%s to root zone\n", | ||
1387 | trusted_name, | ||
1388 | trusted_key); | ||
1389 | put_trusted(trusted_name, trusted_key); | ||
1390 | } | ||
1391 | else | ||
1392 | { | ||
1393 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Keyfile %s does not exist!\n", | ||
1394 | trusted_key); | ||
1395 | //put_trusted(trusted_name, trusted_key); //FIXME for testing | ||
1396 | } | ||
1397 | } | ||
1398 | |||
1399 | } | ||
1400 | |||
1401 | /** | 1360 | /** |
1402 | * handle to the dht | 1361 | * handle to the dht |
1403 | */ | 1362 | */ |
@@ -1408,7 +1367,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1408 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not connect to DHT!\n"); | 1367 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not connect to DHT!\n"); |
1409 | } | 1368 | } |
1410 | 1369 | ||
1411 | put_some_records(); //FIXME for testing | 1370 | //put_some_records(); //FIXME for testing |
1412 | 1371 | ||
1413 | /** | 1372 | /** |
1414 | * Schedule periodic put | 1373 | * Schedule periodic put |