diff options
Diffstat (limited to 'src')
136 files changed, 1857 insertions, 943 deletions
diff --git a/src/arm/arm.conf.in b/src/arm/arm.conf.in index 38cf4599c..64ae35786 100644 --- a/src/arm/arm.conf.in +++ b/src/arm/arm.conf.in | |||
@@ -22,9 +22,9 @@ GLOBAL_PREFIX = @MONKEYPREFIX@ | |||
22 | # system-level services (and we'll expect a second ARM to be | 22 | # system-level services (and we'll expect a second ARM to be |
23 | # run per-user to run user-level services). Note that in this | 23 | # run per-user to run user-level services). Note that in this |
24 | # case you must have manually created a different configuration | 24 | # case you must have manually created a different configuration |
25 | # file with the user where at least this and the USER_ONLY | 25 | # file with the user where at least this and the START_USER_SERVICES |
26 | # options differ. | 26 | # options differ. |
27 | # SYSTEM_ONLY = YES | 27 | # START_SYSTEM_SERVICES = YES |
28 | 28 | ||
29 | # If set to YES, ARM will only start services that are marked as | 29 | # If set to YES, ARM will only start services that are marked as |
30 | # per-user services (and we'll expect a system user to run ARM to | 30 | # per-user services (and we'll expect a system user to run ARM to |
@@ -39,7 +39,7 @@ GLOBAL_PREFIX = @MONKEYPREFIX@ | |||
39 | # USER ARM instances to some free port (counting down from 2085 should | 39 | # USER ARM instances to some free port (counting down from 2085 should |
40 | # be sane). | 40 | # be sane). |
41 | # | 41 | # |
42 | # USER_ONLY = YES | 42 | # START_USER_SERVICES = YES |
43 | 43 | ||
44 | # File where we should log per-service resource consumption on exit. | 44 | # File where we should log per-service resource consumption on exit. |
45 | # RESOURCE_DIAGNOSTICS = resource.log | 45 | # RESOURCE_DIAGNOSTICS = resource.log |
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 6924ca676..bc138e6fc 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -235,6 +235,11 @@ static struct GNUNET_DISK_PipeHandle *sigpipe; | |||
235 | static int in_shutdown; | 235 | static int in_shutdown; |
236 | 236 | ||
237 | /** | 237 | /** |
238 | * Return value from main | ||
239 | */ | ||
240 | static int global_ret; | ||
241 | |||
242 | /** | ||
238 | * Are we starting user services? | 243 | * Are we starting user services? |
239 | */ | 244 | */ |
240 | static int start_user = GNUNET_YES; | 245 | static int start_user = GNUNET_YES; |
@@ -346,11 +351,15 @@ get_server_addresses (const char *service_name, | |||
346 | *addrs = NULL; | 351 | *addrs = NULL; |
347 | *addr_lens = NULL; | 352 | *addr_lens = NULL; |
348 | desc = NULL; | 353 | desc = NULL; |
349 | if (GNUNET_CONFIGURATION_have_value (cfg, service_name, "DISABLEV6")) | 354 | if (GNUNET_CONFIGURATION_have_value (cfg, |
355 | service_name, | ||
356 | "DISABLEV6")) | ||
350 | { | 357 | { |
351 | if (GNUNET_SYSERR == | 358 | if (GNUNET_SYSERR == |
352 | (disablev6 = | 359 | (disablev6 = |
353 | GNUNET_CONFIGURATION_get_value_yesno (cfg, service_name, "DISABLEV6"))) | 360 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
361 | service_name, | ||
362 | "DISABLEV6"))) | ||
354 | return GNUNET_SYSERR; | 363 | return GNUNET_SYSERR; |
355 | } | 364 | } |
356 | else | 365 | else |
@@ -359,18 +368,24 @@ get_server_addresses (const char *service_name, | |||
359 | if (! disablev6) | 368 | if (! disablev6) |
360 | { | 369 | { |
361 | /* probe IPv6 support */ | 370 | /* probe IPv6 support */ |
362 | desc = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0); | 371 | desc = GNUNET_NETWORK_socket_create (PF_INET6, |
372 | SOCK_STREAM, | ||
373 | 0); | ||
363 | if (NULL == desc) | 374 | if (NULL == desc) |
364 | { | 375 | { |
365 | if ((ENOBUFS == errno) || (ENOMEM == errno) || (ENFILE == errno) || | 376 | if ( (ENOBUFS == errno) || |
366 | (EACCES == errno)) | 377 | (ENOMEM == errno) || |
378 | (ENFILE == errno) || | ||
379 | (EACCES == errno) ) | ||
367 | { | 380 | { |
368 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); | 381 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, |
382 | "socket"); | ||
369 | return GNUNET_SYSERR; | 383 | return GNUNET_SYSERR; |
370 | } | 384 | } |
371 | LOG (GNUNET_ERROR_TYPE_INFO, | 385 | LOG (GNUNET_ERROR_TYPE_INFO, |
372 | _("Disabling IPv6 support for service `%s', failed to create IPv6 socket: %s\n"), | 386 | _("Disabling IPv6 support for service `%s', failed to create IPv6 socket: %s\n"), |
373 | service_name, STRERROR (errno)); | 387 | service_name, |
388 | STRERROR (errno)); | ||
374 | disablev6 = GNUNET_YES; | 389 | disablev6 = GNUNET_YES; |
375 | } | 390 | } |
376 | else | 391 | else |
@@ -381,11 +396,15 @@ get_server_addresses (const char *service_name, | |||
381 | } | 396 | } |
382 | 397 | ||
383 | port = 0; | 398 | port = 0; |
384 | if (GNUNET_CONFIGURATION_have_value (cfg, service_name, "PORT")) | 399 | if (GNUNET_CONFIGURATION_have_value (cfg, |
400 | service_name, | ||
401 | "PORT")) | ||
385 | { | 402 | { |
386 | if (GNUNET_OK != | 403 | if (GNUNET_OK != |
387 | GNUNET_CONFIGURATION_get_value_number (cfg, service_name, | 404 | GNUNET_CONFIGURATION_get_value_number (cfg, |
388 | "PORT", &port)) | 405 | service_name, |
406 | "PORT", | ||
407 | &port)) | ||
389 | { | 408 | { |
390 | LOG (GNUNET_ERROR_TYPE_ERROR, | 409 | LOG (GNUNET_ERROR_TYPE_ERROR, |
391 | _("Require valid port number for service `%s' in configuration!\n"), | 410 | _("Require valid port number for service `%s' in configuration!\n"), |
@@ -400,11 +419,15 @@ get_server_addresses (const char *service_name, | |||
400 | } | 419 | } |
401 | } | 420 | } |
402 | 421 | ||
403 | if (GNUNET_CONFIGURATION_have_value (cfg, service_name, "BINDTO")) | 422 | if (GNUNET_CONFIGURATION_have_value (cfg, |
423 | service_name, | ||
424 | "BINDTO")) | ||
404 | { | 425 | { |
405 | GNUNET_break (GNUNET_OK == | 426 | GNUNET_break (GNUNET_OK == |
406 | GNUNET_CONFIGURATION_get_value_string (cfg, service_name, | 427 | GNUNET_CONFIGURATION_get_value_string (cfg, |
407 | "BINDTO", &hostname)); | 428 | service_name, |
429 | "BINDTO", | ||
430 | &hostname)); | ||
408 | } | 431 | } |
409 | else | 432 | else |
410 | hostname = NULL; | 433 | hostname = NULL; |
@@ -413,10 +436,14 @@ get_server_addresses (const char *service_name, | |||
413 | abstract = GNUNET_NO; | 436 | abstract = GNUNET_NO; |
414 | #ifdef AF_UNIX | 437 | #ifdef AF_UNIX |
415 | if ((GNUNET_YES == | 438 | if ((GNUNET_YES == |
416 | GNUNET_CONFIGURATION_have_value (cfg, service_name, "UNIXPATH")) && | 439 | GNUNET_CONFIGURATION_have_value (cfg, |
440 | service_name, | ||
441 | "UNIXPATH")) && | ||
417 | (GNUNET_OK == | 442 | (GNUNET_OK == |
418 | GNUNET_CONFIGURATION_get_value_filename (cfg, service_name, "UNIXPATH", | 443 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
419 | &unixpath)) && | 444 | service_name, |
445 | "UNIXPATH", | ||
446 | &unixpath)) && | ||
420 | (0 < strlen (unixpath))) | 447 | (0 < strlen (unixpath))) |
421 | { | 448 | { |
422 | /* probe UNIX support */ | 449 | /* probe UNIX support */ |
@@ -425,7 +452,8 @@ get_server_addresses (const char *service_name, | |||
425 | if (strlen (unixpath) >= sizeof (s_un.sun_path)) | 452 | if (strlen (unixpath) >= sizeof (s_un.sun_path)) |
426 | { | 453 | { |
427 | LOG (GNUNET_ERROR_TYPE_WARNING, | 454 | LOG (GNUNET_ERROR_TYPE_WARNING, |
428 | _("UNIXPATH `%s' too long, maximum length is %llu\n"), unixpath, | 455 | _("UNIXPATH `%s' too long, maximum length is %llu\n"), |
456 | unixpath, | ||
429 | (unsigned long long) sizeof (s_un.sun_path)); | 457 | (unsigned long long) sizeof (s_un.sun_path)); |
430 | unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath); | 458 | unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath); |
431 | LOG (GNUNET_ERROR_TYPE_INFO, | 459 | LOG (GNUNET_ERROR_TYPE_INFO, |
@@ -439,9 +467,9 @@ get_server_addresses (const char *service_name, | |||
439 | if (GNUNET_SYSERR == abstract) | 467 | if (GNUNET_SYSERR == abstract) |
440 | abstract = GNUNET_NO; | 468 | abstract = GNUNET_NO; |
441 | #endif | 469 | #endif |
442 | if ((GNUNET_YES != abstract) | 470 | if ( (GNUNET_YES != abstract) && |
443 | && (GNUNET_OK != | 471 | (GNUNET_OK != |
444 | GNUNET_DISK_directory_create_for_file (unixpath))) | 472 | GNUNET_DISK_directory_create_for_file (unixpath)) ) |
445 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, | 473 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, |
446 | "mkdir", | 474 | "mkdir", |
447 | unixpath); | 475 | unixpath); |
@@ -451,8 +479,10 @@ get_server_addresses (const char *service_name, | |||
451 | desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0); | 479 | desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0); |
452 | if (NULL == desc) | 480 | if (NULL == desc) |
453 | { | 481 | { |
454 | if ((ENOBUFS == errno) || (ENOMEM == errno) || (ENFILE == errno) || | 482 | if ( (ENOBUFS == errno) || |
455 | (EACCES == errno)) | 483 | (ENOMEM == errno) || |
484 | (ENFILE == errno) || | ||
485 | (EACCES == errno) ) | ||
456 | { | 486 | { |
457 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); | 487 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); |
458 | GNUNET_free_non_null (hostname); | 488 | GNUNET_free_non_null (hostname); |
@@ -474,19 +504,29 @@ get_server_addresses (const char *service_name, | |||
474 | } | 504 | } |
475 | #endif | 505 | #endif |
476 | 506 | ||
477 | if ((0 == port) && (NULL == unixpath)) | 507 | if ( (0 == port) && |
508 | (NULL == unixpath) ) | ||
478 | { | 509 | { |
479 | LOG (GNUNET_ERROR_TYPE_ERROR, | 510 | if (GNUNET_YES == |
480 | _("Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), | 511 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
481 | service_name); | 512 | service_name, |
513 | "START_ON_DEMAND")) | ||
514 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
515 | _("Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), | ||
516 | service_name); | ||
482 | GNUNET_free_non_null (hostname); | 517 | GNUNET_free_non_null (hostname); |
483 | return GNUNET_SYSERR; | 518 | return GNUNET_SYSERR; |
484 | } | 519 | } |
485 | if (0 == port) | 520 | if (0 == port) |
486 | { | 521 | { |
487 | saddrs = GNUNET_malloc (2 * sizeof (struct sockaddr *)); | 522 | saddrs = GNUNET_new_array (2, |
488 | saddrlens = GNUNET_malloc (2 * sizeof (socklen_t)); | 523 | struct sockaddr *); |
489 | add_unixpath (saddrs, saddrlens, unixpath, abstract); | 524 | saddrlens = GNUNET_new_array (2, |
525 | socklen_t); | ||
526 | add_unixpath (saddrs, | ||
527 | saddrlens, | ||
528 | unixpath, | ||
529 | abstract); | ||
490 | GNUNET_free_non_null (unixpath); | 530 | GNUNET_free_non_null (unixpath); |
491 | GNUNET_free_non_null (hostname); | 531 | GNUNET_free_non_null (hostname); |
492 | *addrs = saddrs; | 532 | *addrs = saddrs; |
@@ -504,7 +544,10 @@ get_server_addresses (const char *service_name, | |||
504 | if (disablev6) | 544 | if (disablev6) |
505 | hints.ai_family = AF_INET; | 545 | hints.ai_family = AF_INET; |
506 | hints.ai_protocol = IPPROTO_TCP; | 546 | hints.ai_protocol = IPPROTO_TCP; |
507 | if ((0 != (ret = getaddrinfo (hostname, NULL, &hints, &res))) || | 547 | if ((0 != (ret = getaddrinfo (hostname, |
548 | NULL, | ||
549 | &hints, | ||
550 | &res))) || | ||
508 | (NULL == res)) | 551 | (NULL == res)) |
509 | { | 552 | { |
510 | LOG (GNUNET_ERROR_TYPE_ERROR, | 553 | LOG (GNUNET_ERROR_TYPE_ERROR, |
@@ -538,8 +581,10 @@ get_server_addresses (const char *service_name, | |||
538 | resi = i; | 581 | resi = i; |
539 | if (NULL != unixpath) | 582 | if (NULL != unixpath) |
540 | resi++; | 583 | resi++; |
541 | saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *)); | 584 | saddrs = GNUNET_new_array (resi + 1, |
542 | saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t)); | 585 | struct sockaddr *); |
586 | saddrlens = GNUNET_new_array (resi + 1, | ||
587 | socklen_t); | ||
543 | i = 0; | 588 | i = 0; |
544 | if (NULL != unixpath) | 589 | if (NULL != unixpath) |
545 | { | 590 | { |
@@ -591,8 +636,10 @@ get_server_addresses (const char *service_name, | |||
591 | if (NULL != unixpath) | 636 | if (NULL != unixpath) |
592 | resi++; | 637 | resi++; |
593 | i = 0; | 638 | i = 0; |
594 | saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *)); | 639 | saddrs = GNUNET_new_array (resi + 1, |
595 | saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t)); | 640 | struct sockaddr *); |
641 | saddrlens = GNUNET_new_array (resi + 1, | ||
642 | socklen_t); | ||
596 | if (NULL != unixpath) | 643 | if (NULL != unixpath) |
597 | { | 644 | { |
598 | add_unixpath (saddrs, saddrlens, unixpath, abstract); | 645 | add_unixpath (saddrs, saddrlens, unixpath, abstract); |
@@ -612,12 +659,17 @@ get_server_addresses (const char *service_name, | |||
612 | resi = 2; | 659 | resi = 2; |
613 | if (NULL != unixpath) | 660 | if (NULL != unixpath) |
614 | resi++; | 661 | resi++; |
615 | saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *)); | 662 | saddrs = GNUNET_new_array (resi + 1, |
616 | saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t)); | 663 | struct sockaddr *); |
664 | saddrlens = GNUNET_new_array (resi + 1, | ||
665 | socklen_t); | ||
617 | i = 0; | 666 | i = 0; |
618 | if (NULL != unixpath) | 667 | if (NULL != unixpath) |
619 | { | 668 | { |
620 | add_unixpath (saddrs, saddrlens, unixpath, abstract); | 669 | add_unixpath (saddrs, |
670 | saddrlens, | ||
671 | unixpath, | ||
672 | abstract); | ||
621 | i++; | 673 | i++; |
622 | } | 674 | } |
623 | saddrlens[i] = sizeof (struct sockaddr_in6); | 675 | saddrlens[i] = sizeof (struct sockaddr_in6); |
@@ -663,6 +715,7 @@ signal_result (struct GNUNET_SERVICE_Client *client, | |||
663 | struct GNUNET_MQ_Envelope *env; | 715 | struct GNUNET_MQ_Envelope *env; |
664 | struct GNUNET_ARM_ResultMessage *msg; | 716 | struct GNUNET_ARM_ResultMessage *msg; |
665 | 717 | ||
718 | (void) name; | ||
666 | env = GNUNET_MQ_msg (msg, | 719 | env = GNUNET_MQ_msg (msg, |
667 | GNUNET_MESSAGE_TYPE_ARM_RESULT); | 720 | GNUNET_MESSAGE_TYPE_ARM_RESULT); |
668 | msg->result = htonl (result); | 721 | msg->result = htonl (result); |
@@ -1184,6 +1237,7 @@ check_start (void *cls, | |||
1184 | uint16_t size; | 1237 | uint16_t size; |
1185 | const char *servicename; | 1238 | const char *servicename; |
1186 | 1239 | ||
1240 | (void) cls; | ||
1187 | size = ntohs (amsg->header.size) - sizeof (struct GNUNET_ARM_Message); | 1241 | size = ntohs (amsg->header.size) - sizeof (struct GNUNET_ARM_Message); |
1188 | servicename = (const char *) &amsg[1]; | 1242 | servicename = (const char *) &amsg[1]; |
1189 | if ( (0 == size) || | 1243 | if ( (0 == size) || |
@@ -1254,6 +1308,7 @@ handle_start (void *cls, | |||
1254 | static void | 1308 | static void |
1255 | trigger_shutdown (void *cls) | 1309 | trigger_shutdown (void *cls) |
1256 | { | 1310 | { |
1311 | (void) cls; | ||
1257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1312 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1258 | "Triggering shutdown\n"); | 1313 | "Triggering shutdown\n"); |
1259 | GNUNET_SCHEDULER_shutdown (); | 1314 | GNUNET_SCHEDULER_shutdown (); |
@@ -1275,6 +1330,7 @@ check_stop (void *cls, | |||
1275 | uint16_t size; | 1330 | uint16_t size; |
1276 | const char *servicename; | 1331 | const char *servicename; |
1277 | 1332 | ||
1333 | (void) cls; | ||
1278 | size = ntohs (amsg->header.size) - sizeof (struct GNUNET_ARM_Message); | 1334 | size = ntohs (amsg->header.size) - sizeof (struct GNUNET_ARM_Message); |
1279 | servicename = (const char *) &amsg[1]; | 1335 | servicename = (const char *) &amsg[1]; |
1280 | if ( (0 == size) || | 1336 | if ( (0 == size) || |
@@ -1451,6 +1507,7 @@ handle_test (void *cls, | |||
1451 | struct GNUNET_MQ_Envelope *env; | 1507 | struct GNUNET_MQ_Envelope *env; |
1452 | struct GNUNET_MessageHeader *msg; | 1508 | struct GNUNET_MessageHeader *msg; |
1453 | 1509 | ||
1510 | (void) message; | ||
1454 | env = GNUNET_MQ_msg (msg, | 1511 | env = GNUNET_MQ_msg (msg, |
1455 | GNUNET_MESSAGE_TYPE_ARM_TEST); | 1512 | GNUNET_MESSAGE_TYPE_ARM_TEST); |
1456 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), | 1513 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), |
@@ -1498,7 +1555,7 @@ list_count (struct ServiceList *running_head) | |||
1498 | struct ServiceList *i; | 1555 | struct ServiceList *i; |
1499 | unsigned int res; | 1556 | unsigned int res; |
1500 | 1557 | ||
1501 | for (res = 0, i = running_head; i; i = i->next, res++) | 1558 | for (res = 0, i = running_head; NULL != i; i = i->next, res++) |
1502 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1559 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1503 | "%s\n", | 1560 | "%s\n", |
1504 | i->name); | 1561 | i->name); |
@@ -1518,6 +1575,7 @@ shutdown_task (void *cls) | |||
1518 | struct ServiceList *nxt; | 1575 | struct ServiceList *nxt; |
1519 | struct ServiceListeningInfo *sli; | 1576 | struct ServiceListeningInfo *sli; |
1520 | 1577 | ||
1578 | (void) cls; | ||
1521 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1579 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1522 | "First shutdown phase\n"); | 1580 | "First shutdown phase\n"); |
1523 | if (NULL != child_restart_task) | 1581 | if (NULL != child_restart_task) |
@@ -1589,6 +1647,7 @@ delayed_restart_task (void *cls) | |||
1589 | struct GNUNET_TIME_Relative lowestRestartDelay; | 1647 | struct GNUNET_TIME_Relative lowestRestartDelay; |
1590 | struct ServiceListeningInfo *sli; | 1648 | struct ServiceListeningInfo *sli; |
1591 | 1649 | ||
1650 | (void) cls; | ||
1592 | child_restart_task = NULL; | 1651 | child_restart_task = NULL; |
1593 | GNUNET_assert (GNUNET_NO == in_shutdown); | 1652 | GNUNET_assert (GNUNET_NO == in_shutdown); |
1594 | lowestRestartDelay = GNUNET_TIME_UNIT_FOREVER_REL; | 1653 | lowestRestartDelay = GNUNET_TIME_UNIT_FOREVER_REL; |
@@ -1656,7 +1715,7 @@ delayed_restart_task (void *cls) | |||
1656 | * Task triggered whenever we receive a SIGCHLD (child | 1715 | * Task triggered whenever we receive a SIGCHLD (child |
1657 | * process died). | 1716 | * process died). |
1658 | * | 1717 | * |
1659 | * @param cls closure, NULL if we need to self-restart | 1718 | * @param cls closure, NULL |
1660 | */ | 1719 | */ |
1661 | static void | 1720 | static void |
1662 | maint_child_death (void *cls) | 1721 | maint_child_death (void *cls) |
@@ -1672,6 +1731,7 @@ maint_child_death (void *cls) | |||
1672 | unsigned long statusCode; | 1731 | unsigned long statusCode; |
1673 | const struct GNUNET_DISK_FileHandle *pr; | 1732 | const struct GNUNET_DISK_FileHandle *pr; |
1674 | 1733 | ||
1734 | (void) cls; | ||
1675 | pr = GNUNET_DISK_pipe_handle (sigpipe, | 1735 | pr = GNUNET_DISK_pipe_handle (sigpipe, |
1676 | GNUNET_DISK_PIPE_END_READ); | 1736 | GNUNET_DISK_PIPE_END_READ); |
1677 | child_death_task = NULL; | 1737 | child_death_task = NULL; |
@@ -1914,6 +1974,7 @@ setup_service (void *cls, | |||
1914 | socklen_t *addr_lens; | 1974 | socklen_t *addr_lens; |
1915 | int ret; | 1975 | int ret; |
1916 | 1976 | ||
1977 | (void) cls; | ||
1917 | if (0 == strcasecmp (section, | 1978 | if (0 == strcasecmp (section, |
1918 | "arm")) | 1979 | "arm")) |
1919 | return; | 1980 | return; |
@@ -1929,11 +1990,11 @@ setup_service (void *cls, | |||
1929 | if ((GNUNET_YES == | 1990 | if ((GNUNET_YES == |
1930 | GNUNET_CONFIGURATION_have_value (cfg, | 1991 | GNUNET_CONFIGURATION_have_value (cfg, |
1931 | section, | 1992 | section, |
1932 | "USER_SERVICE")) && | 1993 | "RUN_PER_USER")) && |
1933 | (GNUNET_YES == | 1994 | (GNUNET_YES == |
1934 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 1995 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
1935 | section, | 1996 | section, |
1936 | "USER_SERVICE"))) | 1997 | "RUN_PER_USER"))) |
1937 | { | 1998 | { |
1938 | if (GNUNET_NO == start_user) | 1999 | if (GNUNET_NO == start_user) |
1939 | { | 2000 | { |
@@ -2001,7 +2062,7 @@ setup_service (void *cls, | |||
2001 | if (GNUNET_YES == | 2062 | if (GNUNET_YES == |
2002 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 2063 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2003 | section, | 2064 | section, |
2004 | "FORCESTART")) | 2065 | "IMMEDIATE_START")) |
2005 | { | 2066 | { |
2006 | sl->force_start = GNUNET_YES; | 2067 | sl->force_start = GNUNET_YES; |
2007 | if (GNUNET_YES == | 2068 | if (GNUNET_YES == |
@@ -2015,7 +2076,7 @@ setup_service (void *cls, | |||
2015 | if (GNUNET_YES != | 2076 | if (GNUNET_YES != |
2016 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 2077 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2017 | section, | 2078 | section, |
2018 | "AUTOSTART")) | 2079 | "START_ON_DEMAND")) |
2019 | return; | 2080 | return; |
2020 | } | 2081 | } |
2021 | if (0 >= (ret = get_server_addresses (section, | 2082 | if (0 >= (ret = get_server_addresses (section, |
@@ -2024,7 +2085,7 @@ setup_service (void *cls, | |||
2024 | &addr_lens))) | 2085 | &addr_lens))) |
2025 | return; | 2086 | return; |
2026 | /* this will free (or capture) addrs[i] */ | 2087 | /* this will free (or capture) addrs[i] */ |
2027 | for (unsigned int i = 0; i < ret; i++) | 2088 | for (unsigned int i = 0; i < (unsigned int) ret; i++) |
2028 | create_listen_socket (addrs[i], | 2089 | create_listen_socket (addrs[i], |
2029 | addr_lens[i], | 2090 | addr_lens[i], |
2030 | sl); | 2091 | sl); |
@@ -2049,6 +2110,8 @@ client_connect_cb (void *cls, | |||
2049 | /* All clients are considered to be of the "monitor" kind | 2110 | /* All clients are considered to be of the "monitor" kind |
2050 | * (that is, they don't affect ARM shutdown). | 2111 | * (that is, they don't affect ARM shutdown). |
2051 | */ | 2112 | */ |
2113 | (void) cls; | ||
2114 | (void) mq; | ||
2052 | GNUNET_SERVICE_client_mark_monitor (client); | 2115 | GNUNET_SERVICE_client_mark_monitor (client); |
2053 | return client; | 2116 | return client; |
2054 | } | 2117 | } |
@@ -2066,11 +2129,9 @@ client_disconnect_cb (void *cls, | |||
2066 | struct GNUNET_SERVICE_Client *client, | 2129 | struct GNUNET_SERVICE_Client *client, |
2067 | void *app_ctx) | 2130 | void *app_ctx) |
2068 | { | 2131 | { |
2069 | struct ServiceList *sl; | 2132 | (void) cls; |
2070 | |||
2071 | GNUNET_assert (client == app_ctx); | 2133 | GNUNET_assert (client == app_ctx); |
2072 | 2134 | for (struct ServiceList *sl = running_head; NULL != sl; sl = sl->next) | |
2073 | for (sl = running_head; NULL != sl; sl = sl->next) | ||
2074 | if (sl->killing_client == client) | 2135 | if (sl->killing_client == client) |
2075 | sl->killing_client = NULL; | 2136 | sl->killing_client = NULL; |
2076 | } | 2137 | } |
@@ -2090,6 +2151,7 @@ handle_monitor (void *cls, | |||
2090 | { | 2151 | { |
2091 | struct GNUNET_SERVICE_Client *client = cls; | 2152 | struct GNUNET_SERVICE_Client *client = cls; |
2092 | 2153 | ||
2154 | (void) message; | ||
2093 | /* FIXME: might want to start by letting monitor know about | 2155 | /* FIXME: might want to start by letting monitor know about |
2094 | services that are already running */ | 2156 | services that are already running */ |
2095 | /* Removal is handled by the server implementation, internally. */ | 2157 | /* Removal is handled by the server implementation, internally. */ |
@@ -2105,7 +2167,7 @@ handle_monitor (void *cls, | |||
2105 | /** | 2167 | /** |
2106 | * Process arm requests. | 2168 | * Process arm requests. |
2107 | * | 2169 | * |
2108 | * @param cls closure | 2170 | * @param cls closure, NULL |
2109 | * @param serv the initialized service | 2171 | * @param serv the initialized service |
2110 | * @param c configuration to use | 2172 | * @param c configuration to use |
2111 | */ | 2173 | */ |
@@ -2116,6 +2178,7 @@ run (void *cls, | |||
2116 | { | 2178 | { |
2117 | struct ServiceList *sl; | 2179 | struct ServiceList *sl; |
2118 | 2180 | ||
2181 | (void) cls; | ||
2119 | cfg = c; | 2182 | cfg = c; |
2120 | service = serv; | 2183 | service = serv; |
2121 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 2184 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, |
@@ -2161,21 +2224,20 @@ run (void *cls, | |||
2161 | else | 2224 | else |
2162 | final_option = GNUNET_CONFIGURATION_expand_dollar (cfg, | 2225 | final_option = GNUNET_CONFIGURATION_expand_dollar (cfg, |
2163 | final_option); | 2226 | final_option); |
2164 | if (GNUNET_YES == | 2227 | start_user = GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2165 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
2166 | "ARM", | 2228 | "ARM", |
2167 | "USER_ONLY")) | 2229 | "START_USER_SERVICES"); |
2168 | { | 2230 | start_system = GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2169 | GNUNET_break (GNUNET_YES == start_user); | ||
2170 | start_system = GNUNET_NO; | ||
2171 | } | ||
2172 | if (GNUNET_YES == | ||
2173 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
2174 | "ARM", | 2231 | "ARM", |
2175 | "SYSTEM_ONLY")) | 2232 | "START_SYSTEM_SERVICES"); |
2233 | if ( (GNUNET_NO == start_user) && | ||
2234 | (GNUNET_NO == start_system) ) | ||
2176 | { | 2235 | { |
2177 | GNUNET_break (GNUNET_YES == start_system); | 2236 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2178 | start_user = GNUNET_NO; | 2237 | "Please configure either START_USER_SERVICES or START_SYSTEM_SERVICES or both.\n"); |
2238 | GNUNET_SCHEDULER_shutdown (); | ||
2239 | global_ret = 1; | ||
2240 | return; | ||
2179 | } | 2241 | } |
2180 | GNUNET_CONFIGURATION_iterate_sections (cfg, | 2242 | GNUNET_CONFIGURATION_iterate_sections (cfg, |
2181 | &setup_service, | 2243 | &setup_service, |
@@ -2202,7 +2264,6 @@ int | |||
2202 | main (int argc, | 2264 | main (int argc, |
2203 | char *const *argv) | 2265 | char *const *argv) |
2204 | { | 2266 | { |
2205 | int ret; | ||
2206 | struct GNUNET_SIGNAL_Context *shc_chld; | 2267 | struct GNUNET_SIGNAL_Context *shc_chld; |
2207 | struct GNUNET_MQ_MessageHandler handlers[] = { | 2268 | struct GNUNET_MQ_MessageHandler handlers[] = { |
2208 | GNUNET_MQ_hd_var_size (start, | 2269 | GNUNET_MQ_hd_var_size (start, |
@@ -2236,7 +2297,7 @@ main (int argc, | |||
2236 | shc_chld = | 2297 | shc_chld = |
2237 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, | 2298 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, |
2238 | &sighandler_child_death); | 2299 | &sighandler_child_death); |
2239 | ret = GNUNET_SERVICE_run_ (argc, | 2300 | if ( GNUNET_OK != GNUNET_SERVICE_run_ (argc, |
2240 | argv, | 2301 | argv, |
2241 | "arm", | 2302 | "arm", |
2242 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, | 2303 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, |
@@ -2244,7 +2305,8 @@ main (int argc, | |||
2244 | &client_connect_cb, | 2305 | &client_connect_cb, |
2245 | &client_disconnect_cb, | 2306 | &client_disconnect_cb, |
2246 | NULL, | 2307 | NULL, |
2247 | handlers); | 2308 | handlers)) |
2309 | global_ret = 2; | ||
2248 | #if HAVE_WAIT4 | 2310 | #if HAVE_WAIT4 |
2249 | if (NULL != wait_file) | 2311 | if (NULL != wait_file) |
2250 | { | 2312 | { |
@@ -2261,7 +2323,7 @@ main (int argc, | |||
2261 | shc_chld = NULL; | 2323 | shc_chld = NULL; |
2262 | GNUNET_DISK_pipe_close (sigpipe); | 2324 | GNUNET_DISK_pipe_close (sigpipe); |
2263 | sigpipe = NULL; | 2325 | sigpipe = NULL; |
2264 | return ret; | 2326 | return global_ret; |
2265 | } | 2327 | } |
2266 | 2328 | ||
2267 | 2329 | ||
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf index b032cc95a..276b313b7 100644 --- a/src/arm/test_arm_api_data.conf +++ b/src/arm/test_arm_api_data.conf | |||
@@ -10,12 +10,12 @@ OPTIONS = -L ERROR | |||
10 | #PREFIX = valgrind --tool=memcheck --leak-check=yes | 10 | #PREFIX = valgrind --tool=memcheck --leak-check=yes |
11 | 11 | ||
12 | [resolver] | 12 | [resolver] |
13 | AUTOSTART = YES | 13 | START_ON_DEMAND = YES |
14 | PORT = 23355 | 14 | PORT = 23355 |
15 | # PREFIX = valgrind | 15 | # PREFIX = valgrind |
16 | 16 | ||
17 | [do-nothing] | 17 | [do-nothing] |
18 | AUTOSTART = NO | 18 | START_ON_DEMAND = NO |
19 | PORT = 2223 | 19 | PORT = 2223 |
20 | HOSTNAME = localhost | 20 | HOSTNAME = localhost |
21 | BINARY = /will/be/overwritten/by/test_exponential_backoff | 21 | BINARY = /will/be/overwritten/by/test_exponential_backoff |
@@ -23,16 +23,16 @@ ACCEPT_FROM = 127.0.0.1; | |||
23 | ACCEPT_FROM6 = ::1; | 23 | ACCEPT_FROM6 = ::1; |
24 | 24 | ||
25 | [statistics] | 25 | [statistics] |
26 | AUTOSTART = YES | 26 | START_ON_DEMAND = YES |
27 | 27 | ||
28 | [core] | 28 | [core] |
29 | AUTOSTART = NO | 29 | START_ON_DEMAND = NO |
30 | 30 | ||
31 | [transport] | 31 | [transport] |
32 | AUTOSTART = NO | 32 | START_ON_DEMAND = NO |
33 | 33 | ||
34 | [ats] | 34 | [ats] |
35 | AUTOSTART = NO | 35 | START_ON_DEMAND = NO |
36 | 36 | ||
37 | [peerinfo] | 37 | [peerinfo] |
38 | AUTOSTART = NO | 38 | START_ON_DEMAND = NO |
diff --git a/src/ats-tests/Makefile.am b/src/ats-tests/Makefile.am index 53b37b558..c85645b9d 100644 --- a/src/ats-tests/Makefile.am +++ b/src/ats-tests/Makefile.am | |||
@@ -59,6 +59,7 @@ libgnunetatstesting_la_SOURCES = \ | |||
59 | ats-testing-experiment.c ats-testing-preferences.c | 59 | ats-testing-experiment.c ats-testing-preferences.c |
60 | libgnunetatstesting_la_LIBADD = \ | 60 | libgnunetatstesting_la_LIBADD = \ |
61 | $(top_builddir)/src/testbed/libgnunettestbed.la \ | 61 | $(top_builddir)/src/testbed/libgnunettestbed.la \ |
62 | $(top_builddir)/src/core/libgnunetcore.la \ | ||
62 | $(top_builddir)/src/ats/libgnunetats.la \ | 63 | $(top_builddir)/src/ats/libgnunetats.la \ |
63 | $(top_builddir)/src/util/libgnunetutil.la \ | 64 | $(top_builddir)/src/util/libgnunetutil.la \ |
64 | $(GN_LIBINTL) | 65 | $(GN_LIBINTL) |
diff --git a/src/ats/ats.conf.in b/src/ats/ats.conf.in index d9e867bde..53c0de0c5 100644 --- a/src/ats/ats.conf.in +++ b/src/ats/ats.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [ats] | 1 | [ats] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@ PORT = 2098 | 3 | @UNIXONLY@ PORT = 2098 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-ats | 5 | BINARY = gnunet-service-ats |
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index caa1da034..0c196ea43 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c | |||
@@ -849,7 +849,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p | |||
849 | count = 0; | 849 | count = 0; |
850 | va_start(ap, peer); | 850 | va_start(ap, peer); |
851 | while (GNUNET_ATS_PREFERENCE_END != | 851 | while (GNUNET_ATS_PREFERENCE_END != |
852 | (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) | 852 | (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) )) |
853 | { | 853 | { |
854 | switch (kind) | 854 | switch (kind) |
855 | { | 855 | { |
@@ -875,7 +875,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p | |||
875 | count = 0; | 875 | count = 0; |
876 | va_start(ap, peer); | 876 | va_start(ap, peer); |
877 | while (GNUNET_ATS_PREFERENCE_END != (kind = | 877 | while (GNUNET_ATS_PREFERENCE_END != (kind = |
878 | va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) | 878 | GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) )) |
879 | { | 879 | { |
880 | pi[count].preference_kind = htonl (kind); | 880 | pi[count].preference_kind = htonl (kind); |
881 | switch (kind) | 881 | switch (kind) |
@@ -927,7 +927,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, | |||
927 | count = 0; | 927 | count = 0; |
928 | va_start(ap, scope); | 928 | va_start(ap, scope); |
929 | while (GNUNET_ATS_PREFERENCE_END != | 929 | while (GNUNET_ATS_PREFERENCE_END != |
930 | (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) | 930 | (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) )) |
931 | { | 931 | { |
932 | switch (kind) | 932 | switch (kind) |
933 | { | 933 | { |
@@ -954,7 +954,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, | |||
954 | count = 0; | 954 | count = 0; |
955 | va_start(ap, scope); | 955 | va_start(ap, scope); |
956 | while (GNUNET_ATS_PREFERENCE_END != (kind = | 956 | while (GNUNET_ATS_PREFERENCE_END != (kind = |
957 | va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) | 957 | GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) )) |
958 | { | 958 | { |
959 | pi[count].preference_kind = htonl (kind); | 959 | pi[count].preference_kind = htonl (kind); |
960 | switch (kind) | 960 | switch (kind) |
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index b4ca70dc7..08fb7a9a7 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -1005,7 +1005,7 @@ GAS_proportional_address_property_changed (void *solver, | |||
1005 | static void | 1005 | static void |
1006 | GAS_proportional_address_add (void *solver, | 1006 | GAS_proportional_address_add (void *solver, |
1007 | struct ATS_Address *address, | 1007 | struct ATS_Address *address, |
1008 | enum GNUNET_ATS_Network_Type network) | 1008 | uint32_t network) |
1009 | { | 1009 | { |
1010 | struct GAS_PROPORTIONAL_Handle *s = solver; | 1010 | struct GAS_PROPORTIONAL_Handle *s = solver; |
1011 | struct Network *net; | 1011 | struct Network *net; |
diff --git a/src/auction/auction.conf b/src/auction/auction.conf index 6ca35896b..deb9ac1fc 100644 --- a/src/auction/auction.conf +++ b/src/auction/auction.conf | |||
@@ -1,4 +1,4 @@ | |||
1 | [auction] | 1 | [auction] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | BINARY = gnunet-service-auction | 3 | BINARY = gnunet-service-auction |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-auction.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-auction.sock |
diff --git a/src/cadet/cadet.conf.in b/src/cadet/cadet.conf.in index d50e168f0..2f4c6a6db 100644 --- a/src/cadet/cadet.conf.in +++ b/src/cadet/cadet.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [cadet] | 1 | [cadet] |
2 | FORCESTART = YES | 2 | IMMEDIATE_START = YES |
3 | AUTOSTART = @AUTOSTART@ | 3 | START_ON_DEMAND = @START_ON_DEMAND@ |
4 | @JAVAPORT@PORT = 2096 | 4 | @JAVAPORT@PORT = 2096 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-cadet | 6 | BINARY = gnunet-service-cadet |
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c index 0cabb86e9..04a595a7b 100644 --- a/src/cadet/gnunet-cadet.c +++ b/src/cadet/gnunet-cadet.c | |||
@@ -373,6 +373,7 @@ send_echo (void *cls) | |||
373 | static void | 373 | static void |
374 | request_dump (void *cls) | 374 | request_dump (void *cls) |
375 | { | 375 | { |
376 | job = NULL; | ||
376 | GNUNET_CADET_request_dump (mh); | 377 | GNUNET_CADET_request_dump (mh); |
377 | GNUNET_SCHEDULER_shutdown (); | 378 | GNUNET_SCHEDULER_shutdown (); |
378 | } | 379 | } |
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c index 668b4ddb5..38037e92f 100644 --- a/src/cadet/gnunet-service-cadet.c +++ b/src/cadet/gnunet-service-cadet.c | |||
@@ -874,7 +874,7 @@ path_info_iterator (void *cls, | |||
874 | { | 874 | { |
875 | struct GNUNET_MQ_Handle *mq = cls; | 875 | struct GNUNET_MQ_Handle *mq = cls; |
876 | struct GNUNET_MQ_Envelope *env; | 876 | struct GNUNET_MQ_Envelope *env; |
877 | struct GNUNET_MessageHeader *resp; | 877 | struct GNUNET_CADET_LocalInfoPeer *resp; |
878 | struct GNUNET_PeerIdentity *id; | 878 | struct GNUNET_PeerIdentity *id; |
879 | uint16_t path_size; | 879 | uint16_t path_size; |
880 | unsigned int i; | 880 | unsigned int i; |
diff --git a/src/cadet/test_cadet.conf b/src/cadet/test_cadet.conf index f2308df29..5ad67fec2 100644 --- a/src/cadet/test_cadet.conf +++ b/src/cadet/test_cadet.conf | |||
@@ -68,33 +68,33 @@ NO_IO = YES | |||
68 | WORKBITS = 0 | 68 | WORKBITS = 0 |
69 | 69 | ||
70 | [hostlist] | 70 | [hostlist] |
71 | FORCESTART = NO | 71 | IMMEDIATE_START = NO |
72 | AUTOSTART = NO | 72 | START_ON_DEMAND = NO |
73 | 73 | ||
74 | [fs] | 74 | [fs] |
75 | FORCESTART = NO | 75 | IMMEDIATE_START = NO |
76 | AUTOSTART = NO | 76 | START_ON_DEMAND = NO |
77 | 77 | ||
78 | [vpn] | 78 | [vpn] |
79 | FORCESTART = NO | 79 | IMMEDIATE_START = NO |
80 | AUTOSTART = NO | 80 | START_ON_DEMAND = NO |
81 | 81 | ||
82 | [revocation] | 82 | [revocation] |
83 | FORCESTART = NO | 83 | IMMEDIATE_START = NO |
84 | AUTOSTART = NO | 84 | START_ON_DEMAND = NO |
85 | 85 | ||
86 | [gns] | 86 | [gns] |
87 | FORCESTART = NO | 87 | IMMEDIATE_START = NO |
88 | AUTOSTART = NO | 88 | START_ON_DEMAND = NO |
89 | 89 | ||
90 | [namestore] | 90 | [namestore] |
91 | FORCESTART = NO | 91 | IMMEDIATE_START = NO |
92 | AUTOSTART = NO | 92 | START_ON_DEMAND = NO |
93 | 93 | ||
94 | [namecache] | 94 | [namecache] |
95 | FORCESTART = NO | 95 | IMMEDIATE_START = NO |
96 | AUTOSTART = NO | 96 | START_ON_DEMAND = NO |
97 | 97 | ||
98 | [topology] | 98 | [topology] |
99 | FORCESTART = NO | 99 | IMMEDIATE_START = NO |
100 | AUTOSTART = NO | 100 | START_ON_DEMAND = NO |
diff --git a/src/consensus/consensus.conf.in b/src/consensus/consensus.conf.in index 2afee04db..b0fbcaf5a 100644 --- a/src/consensus/consensus.conf.in +++ b/src/consensus/consensus.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [consensus] | 1 | [consensus] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2103 | 3 | @JAVAPORT@PORT = 2103 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-consensus | 5 | BINARY = gnunet-service-consensus |
diff --git a/src/consensus/test_consensus.conf b/src/consensus/test_consensus.conf index 6cb0885b0..fa42c3c1a 100644 --- a/src/consensus/test_consensus.conf +++ b/src/consensus/test_consensus.conf | |||
@@ -17,22 +17,22 @@ BINARY = gnunet-service-evil-consensus | |||
17 | RESOURCE_DIAGNOSTICS = resource.log.${PEERID:-master} | 17 | RESOURCE_DIAGNOSTICS = resource.log.${PEERID:-master} |
18 | 18 | ||
19 | [core] | 19 | [core] |
20 | FORCESTART = YES | 20 | IMMEDIATE_START = YES |
21 | 21 | ||
22 | [revocation] | 22 | [revocation] |
23 | FORCESTART = NO | 23 | IMMEDIATE_START = NO |
24 | 24 | ||
25 | [fs] | 25 | [fs] |
26 | FORCESTART = NO | 26 | IMMEDIATE_START = NO |
27 | 27 | ||
28 | [gns] | 28 | [gns] |
29 | FORCESTART = NO | 29 | IMMEDIATE_START = NO |
30 | 30 | ||
31 | [zonemaster] | 31 | [zonemaster] |
32 | FORCESTART = NO | 32 | IMMEDIATE_START = NO |
33 | 33 | ||
34 | [hostlist] | 34 | [hostlist] |
35 | FORCESTART = NO | 35 | IMMEDIATE_START = NO |
36 | 36 | ||
37 | [cadet] | 37 | [cadet] |
38 | #PREFIX = valgrind | 38 | #PREFIX = valgrind |
@@ -54,13 +54,13 @@ OPERATION_TIMEOUT = 60 s | |||
54 | MAX_OPEN_FDS = 4096 | 54 | MAX_OPEN_FDS = 4096 |
55 | 55 | ||
56 | [hostlist] | 56 | [hostlist] |
57 | AUTOSTART = NO | 57 | START_ON_DEMAND = NO |
58 | 58 | ||
59 | [fs] | 59 | [fs] |
60 | AUTOSTART = NO | 60 | START_ON_DEMAND = NO |
61 | 61 | ||
62 | [revocation] | 62 | [revocation] |
63 | AUTOSTART = NO | 63 | START_ON_DEMAND = NO |
64 | 64 | ||
65 | [nat] | 65 | [nat] |
66 | # Use addresses from the local network interfaces (inluding loopback, but also others) | 66 | # Use addresses from the local network interfaces (inluding loopback, but also others) |
diff --git a/src/conversation/conversation.conf.in b/src/conversation/conversation.conf.in index e966ed6d9..b28fb6e1f 100644 --- a/src/conversation/conversation.conf.in +++ b/src/conversation/conversation.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [conversation] | 1 | [conversation] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-conversation | 3 | BINARY = gnunet-service-conversation |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-conversation.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-conversation.sock |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
diff --git a/src/core/core.conf.in b/src/core/core.conf.in index 3f388632e..2b20a109a 100644 --- a/src/core/core.conf.in +++ b/src/core/core.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [core] | 1 | [core] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2092 | 3 | @JAVAPORT@PORT = 2092 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-core | 5 | BINARY = gnunet-service-core |
diff --git a/src/core/test_core_api_send_to_self.conf b/src/core/test_core_api_send_to_self.conf index 83928d04a..ad6d4dc60 100644 --- a/src/core/test_core_api_send_to_self.conf +++ b/src/core/test_core_api_send_to_self.conf | |||
@@ -7,7 +7,7 @@ WAN_QUOTA_IN = 104857600 | |||
7 | WAN_QUOTA_OUT = 104757600 | 7 | WAN_QUOTA_OUT = 104757600 |
8 | 8 | ||
9 | [test-sts] | 9 | [test-sts] |
10 | FORCESTART = YES | 10 | IMMEDIATE_START = YES |
11 | PORT = 9252 | 11 | PORT = 9252 |
12 | HOSTNAME = localhost | 12 | HOSTNAME = localhost |
13 | BINARY = test_core_api_send_to_self | 13 | BINARY = test_core_api_send_to_self |
diff --git a/src/credential/credential.conf.in b/src/credential/credential.conf.in index 71f3066ca..d5a0b1c88 100644 --- a/src/credential/credential.conf.in +++ b/src/credential/credential.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [credential] | 1 | [credential] |
2 | BINARY = gnunet-service-credential | 2 | BINARY = gnunet-service-credential |
3 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-credential.sock | 3 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-credential.sock |
4 | USER_SERVICE = YES | 4 | RUN_PER_USER = YES |
5 | OPTIONS = -L DEBUG \ No newline at end of file | 5 | OPTIONS = -L DEBUG |
diff --git a/src/credential/test_credential_lookup.conf b/src/credential/test_credential_lookup.conf index bd464a1f4..39f68c944 100644 --- a/src/credential/test_credential_lookup.conf +++ b/src/credential/test_credential_lookup.conf | |||
@@ -4,13 +4,13 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-credential-peer-1/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-credential-peer-1/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [transport] | 9 | [transport] |
10 | PLUGINS = | 10 | PLUGINS = |
11 | 11 | ||
12 | [credential] | 12 | [credential] |
13 | AUTOSTART = YES | 13 | START_ON_DEMAND = YES |
14 | PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/credlog | 14 | PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/credlog |
15 | 15 | ||
16 | [rest] | 16 | [rest] |
@@ -18,7 +18,7 @@ PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/r | |||
18 | 18 | ||
19 | [gns] | 19 | [gns] |
20 | #PREFIX = valgrind --leak-check=full --track-origins=yes | 20 | #PREFIX = valgrind --leak-check=full --track-origins=yes |
21 | AUTOSTART = YES | 21 | START_ON_DEMAND = YES |
22 | AUTO_IMPORT_PKEY = YES | 22 | AUTO_IMPORT_PKEY = YES |
23 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | 23 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 |
24 | DEFAULT_LOOKUP_TIMEOUT = 15 s | 24 | DEFAULT_LOOKUP_TIMEOUT = 15 s |
diff --git a/src/datastore/datastore.conf.in b/src/datastore/datastore.conf.in index 721c865c8..21d24bb52 100644 --- a/src/datastore/datastore.conf.in +++ b/src/datastore/datastore.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [datastore] | 1 | [datastore] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-datastore.sock | 3 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-datastore.sock |
4 | UNIX_MATCH_UID = NO | 4 | UNIX_MATCH_UID = NO |
5 | UNIX_MATCH_GID = YES | 5 | UNIX_MATCH_GID = YES |
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 80960c676..fc1706400 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -855,9 +855,10 @@ sqlite_plugin_get_zero_anonymity (void *cls, | |||
855 | void *proc_cls) | 855 | void *proc_cls) |
856 | { | 856 | { |
857 | struct Plugin *plugin = cls; | 857 | struct Plugin *plugin = cls; |
858 | uint32_t type32 = type; | ||
858 | struct GNUNET_SQ_QueryParam params[] = { | 859 | struct GNUNET_SQ_QueryParam params[] = { |
859 | GNUNET_SQ_query_param_uint64 (&next_uid), | 860 | GNUNET_SQ_query_param_uint64 (&next_uid), |
860 | GNUNET_SQ_query_param_uint32 (&type), | 861 | GNUNET_SQ_query_param_uint32 (&type32), |
861 | GNUNET_SQ_query_param_end | 862 | GNUNET_SQ_query_param_end |
862 | }; | 863 | }; |
863 | 864 | ||
diff --git a/src/datastore/test_defaults.conf b/src/datastore/test_defaults.conf index 08e630eb0..1f971de8f 100644 --- a/src/datastore/test_defaults.conf +++ b/src/datastore/test_defaults.conf | |||
@@ -4,7 +4,7 @@ | |||
4 | [datastore] | 4 | [datastore] |
5 | PORT = 22654 | 5 | PORT = 22654 |
6 | QUOTA = 1 MB | 6 | QUOTA = 1 MB |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [nse] | 9 | [nse] |
10 | WORKBITS = 1 | 10 | WORKBITS = 1 |
diff --git a/src/dht/dht.conf.in b/src/dht/dht.conf.in index f828b725f..405ef1917 100644 --- a/src/dht/dht.conf.in +++ b/src/dht/dht.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [dht] | 1 | [dht] |
2 | FORCESTART = YES | 2 | IMMEDIATE_START = YES |
3 | AUTOSTART = @AUTOSTART@ | 3 | START_ON_DEMAND = @START_ON_DEMAND@ |
4 | @JAVAPORT@PORT = 2095 | 4 | @JAVAPORT@PORT = 2095 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-dht | 6 | BINARY = gnunet-service-dht |
diff --git a/src/dht/test_dht_2dtorus.conf b/src/dht/test_dht_2dtorus.conf index a541e8443..0e546cf68 100644 --- a/src/dht/test_dht_2dtorus.conf +++ b/src/dht/test_dht_2dtorus.conf | |||
@@ -4,8 +4,8 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test_dht_2dtorus/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test_dht_2dtorus/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | FORCESTART = YES | 8 | IMMEDIATE_START = YES |
9 | 9 | ||
10 | [dhtcache] | 10 | [dhtcache] |
11 | QUOTA = 1 MB | 11 | QUOTA = 1 MB |
@@ -28,7 +28,7 @@ WAN_QUOTA_OUT = 1 GB | |||
28 | OVERLAY_TOPOLOGY = 2D_TORUS | 28 | OVERLAY_TOPOLOGY = 2D_TORUS |
29 | 29 | ||
30 | [nse] | 30 | [nse] |
31 | AUTOSTART = YES | 31 | START_ON_DEMAND = YES |
32 | WORKDELAY = 500 ms | 32 | WORKDELAY = 500 ms |
33 | INTERVAL = 60 s | 33 | INTERVAL = 60 s |
34 | WORKBITS = 0 | 34 | WORKBITS = 0 |
diff --git a/src/dht/test_dht_api_data.conf b/src/dht/test_dht_api_data.conf index a2c1829c6..cb875fad4 100644 --- a/src/dht/test_dht_api_data.conf +++ b/src/dht/test_dht_api_data.conf | |||
@@ -36,9 +36,9 @@ INTERNAL_ADDRESS = 127.0.0.1 | |||
36 | EXTERNAL_ADDRESS = 127.0.0.1 | 36 | EXTERNAL_ADDRESS = 127.0.0.1 |
37 | 37 | ||
38 | [dht] | 38 | [dht] |
39 | AUTOSTART = YES | 39 | START_ON_DEMAND = YES |
40 | FORCESTART = YES | 40 | IMMEDIATE_START = YES |
41 | 41 | ||
42 | [nse] | 42 | [nse] |
43 | AUTOSTART = YES | 43 | START_ON_DEMAND = YES |
44 | WORKBITS = 1 | 44 | WORKBITS = 1 |
diff --git a/src/dht/test_dht_api_peer1.conf b/src/dht/test_dht_api_peer1.conf index b4164077f..230aa0fa4 100644 --- a/src/dht/test_dht_api_peer1.conf +++ b/src/dht/test_dht_api_peer1.conf | |||
@@ -33,9 +33,9 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
33 | USE_LOCALADDR = NO | 33 | USE_LOCALADDR = NO |
34 | 34 | ||
35 | [dht] | 35 | [dht] |
36 | AUTOSTART = YES | 36 | START_ON_DEMAND = YES |
37 | FORCESTART = YES | 37 | IMMEDIATE_START = YES |
38 | 38 | ||
39 | [nse] | 39 | [nse] |
40 | AUTOSTART = YES | 40 | START_ON_DEMAND = YES |
41 | WORKBITS = 1 | 41 | WORKBITS = 1 |
diff --git a/src/dht/test_dht_line.conf b/src/dht/test_dht_line.conf index 5368b0baf..62e337ef2 100644 --- a/src/dht/test_dht_line.conf +++ b/src/dht/test_dht_line.conf | |||
@@ -4,8 +4,8 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test_dht_line/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test_dht_line/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | FORCESTART = YES | 8 | IMMEDIATE_START = YES |
9 | 9 | ||
10 | [dhtcache] | 10 | [dhtcache] |
11 | QUOTA = 1 MB | 11 | QUOTA = 1 MB |
@@ -32,7 +32,7 @@ OVERLAY_TOPOLOGY = LINE | |||
32 | plugins = unix | 32 | plugins = unix |
33 | 33 | ||
34 | [nse] | 34 | [nse] |
35 | AUTOSTART = YES | 35 | START_ON_DEMAND = YES |
36 | WORKDELAY = 500 ms | 36 | WORKDELAY = 500 ms |
37 | INTERVAL = 60 s | 37 | INTERVAL = 60 s |
38 | WORKBITS = 0 | 38 | WORKBITS = 0 |
diff --git a/src/dht/test_dht_monitor.conf b/src/dht/test_dht_monitor.conf index c0d457e89..feefc2f5e 100644 --- a/src/dht/test_dht_monitor.conf +++ b/src/dht/test_dht_monitor.conf | |||
@@ -31,9 +31,9 @@ RETURN_LOCAL_ADDRESSES = YES | |||
31 | 31 | ||
32 | 32 | ||
33 | [dht] | 33 | [dht] |
34 | AUTOSTART = YES | 34 | START_ON_DEMAND = YES |
35 | FORCESTART = YES | 35 | IMMEDIATE_START = YES |
36 | 36 | ||
37 | [nse] | 37 | [nse] |
38 | AUTOSTART = YES | 38 | START_ON_DEMAND = YES |
39 | WORKBITS = 1 | 39 | WORKBITS = 1 |
diff --git a/src/dht/test_dht_multipeer.conf b/src/dht/test_dht_multipeer.conf index 4296d783e..ac35664c4 100644 --- a/src/dht/test_dht_multipeer.conf +++ b/src/dht/test_dht_multipeer.conf | |||
@@ -2,8 +2,8 @@ | |||
2 | @INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf | 2 | @INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf |
3 | 3 | ||
4 | [dht] | 4 | [dht] |
5 | AUTOSTART = YES | 5 | START_ON_DEMAND = YES |
6 | FORCESTART = YES | 6 | IMMEDIATE_START = YES |
7 | 7 | ||
8 | [dhtcache] | 8 | [dhtcache] |
9 | QUOTA = 1 MB | 9 | QUOTA = 1 MB |
@@ -34,7 +34,7 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
34 | USE_LOCALADDR = YES | 34 | USE_LOCALADDR = YES |
35 | 35 | ||
36 | [nse] | 36 | [nse] |
37 | AUTOSTART = YES | 37 | START_ON_DEMAND = YES |
38 | WORKDELAY = 500 ms | 38 | WORKDELAY = 500 ms |
39 | INTERVAL = 60 s | 39 | INTERVAL = 60 s |
40 | WORKBITS = 0 | 40 | WORKBITS = 0 |
diff --git a/src/dht/test_dht_tools.conf b/src/dht/test_dht_tools.conf index 46d206448..05f7cc0e6 100644 --- a/src/dht/test_dht_tools.conf +++ b/src/dht/test_dht_tools.conf | |||
@@ -30,128 +30,128 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
30 | USE_LOCALADDR = NO | 30 | USE_LOCALADDR = NO |
31 | 31 | ||
32 | [dht] | 32 | [dht] |
33 | AUTOSTART = YES | 33 | START_ON_DEMAND = YES |
34 | FORCESTART = YES | 34 | IMMEDIATE_START = YES |
35 | 35 | ||
36 | [nse] | 36 | [nse] |
37 | AUTOSTART = YES | 37 | START_ON_DEMAND = YES |
38 | WORKBITS = 1 | 38 | WORKBITS = 1 |
39 | # Configuration to disable autostarting of | 39 | # Configuration to disable autostarting of |
40 | # all services above the 'core' level. | 40 | # all services above the 'core' level. |
41 | # (including resolver) | 41 | # (including resolver) |
42 | 42 | ||
43 | [dns] | 43 | [dns] |
44 | AUTOSTART = NO | 44 | START_ON_DEMAND = NO |
45 | 45 | ||
46 | [cadet] | 46 | [cadet] |
47 | AUTOSTART = NO | 47 | START_ON_DEMAND = NO |
48 | 48 | ||
49 | [datastore] | 49 | [datastore] |
50 | AUTOSTART = NO | 50 | START_ON_DEMAND = NO |
51 | 51 | ||
52 | [fs] | 52 | [fs] |
53 | AUTOSTART = NO | 53 | START_ON_DEMAND = NO |
54 | 54 | ||
55 | [dv] | 55 | [dv] |
56 | AUTOSTART = NO | 56 | START_ON_DEMAND = NO |
57 | 57 | ||
58 | [vpn] | 58 | [vpn] |
59 | AUTOSTART = NO | 59 | START_ON_DEMAND = NO |
60 | 60 | ||
61 | [consensus] | 61 | [consensus] |
62 | AUTOSTART = NO | 62 | START_ON_DEMAND = NO |
63 | 63 | ||
64 | [resolver] | 64 | [resolver] |
65 | AUTOSTART = NO | 65 | START_ON_DEMAND = NO |
66 | 66 | ||
67 | [namestore] | 67 | [namestore] |
68 | AUTOSTART = NO | 68 | START_ON_DEMAND = NO |
69 | 69 | ||
70 | [namecache] | 70 | [namecache] |
71 | AUTOSTART = NO | 71 | START_ON_DEMAND = NO |
72 | 72 | ||
73 | [identity] | 73 | [identity] |
74 | AUTOSTART = NO | 74 | START_ON_DEMAND = NO |
75 | 75 | ||
76 | [revocation] | 76 | [revocation] |
77 | AUTOSTART = NO | 77 | START_ON_DEMAND = NO |
78 | 78 | ||
79 | [conversation] | 79 | [conversation] |
80 | AUTOSTART = NO | 80 | START_ON_DEMAND = NO |
81 | 81 | ||
82 | [peerstore] | 82 | [peerstore] |
83 | AUTOSTART = NO | 83 | START_ON_DEMAND = NO |
84 | 84 | ||
85 | [psycstore] | 85 | [psycstore] |
86 | AUTOSTART = NO | 86 | START_ON_DEMAND = NO |
87 | 87 | ||
88 | [gns] | 88 | [gns] |
89 | AUTOSTART = NO | 89 | START_ON_DEMAND = NO |
90 | 90 | ||
91 | [regex] | 91 | [regex] |
92 | AUTOSTART = NO | 92 | START_ON_DEMAND = NO |
93 | 93 | ||
94 | [set] | 94 | [set] |
95 | AUTOSTART = NO | 95 | START_ON_DEMAND = NO |
96 | 96 | ||
97 | [scalarproduct-bob] | 97 | [scalarproduct-bob] |
98 | AUTOSTART = NO | 98 | START_ON_DEMAND = NO |
99 | 99 | ||
100 | [scalarproduct-alice] | 100 | [scalarproduct-alice] |
101 | AUTOSTART = NO | 101 | START_ON_DEMAND = NO |
102 | 102 | ||
103 | [social] | 103 | [social] |
104 | AUTOSTART = NO | 104 | START_ON_DEMAND = NO |
105 | 105 | ||
106 | [psyc] | 106 | [psyc] |
107 | AUTOSTART = NO | 107 | START_ON_DEMAND = NO |
108 | 108 | ||
109 | [rps] | 109 | [rps] |
110 | AUTOSTART = NO | 110 | START_ON_DEMAND = NO |
111 | 111 | ||
112 | [multicast] | 112 | [multicast] |
113 | AUTOSTART = NO | 113 | START_ON_DEMAND = NO |
114 | 114 | ||
115 | [sensordashboard] | 115 | [sensordashboard] |
116 | AUTOSTART = NO | 116 | START_ON_DEMAND = NO |
117 | 117 | ||
118 | [sensor] | 118 | [sensor] |
119 | AUTOSTART = NO | 119 | START_ON_DEMAND = NO |
120 | # Configuration file that can be included to prevent ANY of the usual | 120 | # Configuration file that can be included to prevent ANY of the usual |
121 | # FORCESTART = YES to be set. Also disables NSE POW calculation. | 121 | # IMMEDIATE_START = YES to be set. Also disables NSE POW calculation. |
122 | # | 122 | # |
123 | # This configuration is included from various configuration test files. | 123 | # This configuration is included from various configuration test files. |
124 | # Whenever a new service is added that has FORCESTART = YES for | 124 | # Whenever a new service is added that has IMMEDIATE_START = YES for |
125 | # production should be disabled for (most) test suites, the option should | 125 | # production should be disabled for (most) test suites, the option should |
126 | # be added here instead of all over the place ;-). | 126 | # be added here instead of all over the place ;-). |
127 | 127 | ||
128 | [core] | 128 | [core] |
129 | FORCESTART = NO | 129 | IMMEDIATE_START = NO |
130 | 130 | ||
131 | [fs] | 131 | [fs] |
132 | FORCESTART = NO | 132 | IMMEDIATE_START = NO |
133 | 133 | ||
134 | [dht] | 134 | [dht] |
135 | FORCESTART = NO | 135 | IMMEDIATE_START = NO |
136 | 136 | ||
137 | [cadet] | 137 | [cadet] |
138 | FORCESTART = NO | 138 | IMMEDIATE_START = NO |
139 | 139 | ||
140 | [nse] | 140 | [nse] |
141 | FORCESTART = NO | 141 | IMMEDIATE_START = NO |
142 | WORKBITS = 0 | 142 | WORKBITS = 0 |
143 | 143 | ||
144 | [revocation] | 144 | [revocation] |
145 | FORCESTART = NO | 145 | IMMEDIATE_START = NO |
146 | 146 | ||
147 | [topology] | 147 | [topology] |
148 | FORCESTART = NO | 148 | IMMEDIATE_START = NO |
149 | 149 | ||
150 | [hostlist] | 150 | [hostlist] |
151 | FORCESTART = NO | 151 | IMMEDIATE_START = NO |
152 | 152 | ||
153 | [gns] | 153 | [gns] |
154 | FORCESTART = NO | 154 | IMMEDIATE_START = NO |
155 | 155 | ||
156 | [zonemaster] | 156 | [zonemaster] |
157 | FORCESTART = NO \ No newline at end of file | 157 | IMMEDIATE_START = NO |
diff --git a/src/dns/dns.conf.in b/src/dns/dns.conf.in index 000b73cf1..39f260813 100644 --- a/src/dns/dns.conf.in +++ b/src/dns/dns.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [dns] | 1 | [dns] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | HOSTNAME = localhost | 3 | HOSTNAME = localhost |
4 | BINARY = gnunet-service-dns | 4 | BINARY = gnunet-service-dns |
5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-dns.sock | 5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-dns.sock |
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index c191f0531..6b75fd0f4 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -1097,7 +1097,10 @@ run (void *cls, | |||
1097 | 1097 | ||
1098 | helper_argv[0] = GNUNET_strdup ("gnunet-dns"); | 1098 | helper_argv[0] = GNUNET_strdup ("gnunet-dns"); |
1099 | if (GNUNET_SYSERR == | 1099 | if (GNUNET_SYSERR == |
1100 | GNUNET_CONFIGURATION_get_value_string (cfg, "dns", "IFNAME", &ifc_name)) | 1100 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1101 | "dns", | ||
1102 | "IFNAME", | ||
1103 | &ifc_name)) | ||
1101 | { | 1104 | { |
1102 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1105 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1103 | "No entry 'IFNAME' in configuration!\n"); | 1106 | "No entry 'IFNAME' in configuration!\n"); |
@@ -1106,7 +1109,9 @@ run (void *cls, | |||
1106 | } | 1109 | } |
1107 | helper_argv[1] = ifc_name; | 1110 | helper_argv[1] = ifc_name; |
1108 | if ( (GNUNET_SYSERR == | 1111 | if ( (GNUNET_SYSERR == |
1109 | GNUNET_CONFIGURATION_get_value_string (cfg, "dns", "IPV6ADDR", | 1112 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1113 | "dns", | ||
1114 | "IPV6ADDR", | ||
1110 | &ipv6addr)) ) | 1115 | &ipv6addr)) ) |
1111 | { | 1116 | { |
1112 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1117 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1116,7 +1121,9 @@ run (void *cls, | |||
1116 | } | 1121 | } |
1117 | helper_argv[2] = ipv6addr; | 1122 | helper_argv[2] = ipv6addr; |
1118 | if (GNUNET_SYSERR == | 1123 | if (GNUNET_SYSERR == |
1119 | GNUNET_CONFIGURATION_get_value_string (cfg, "dns", "IPV6PREFIX", | 1124 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1125 | "dns", | ||
1126 | "IPV6PREFIX", | ||
1120 | &ipv6prefix)) | 1127 | &ipv6prefix)) |
1121 | { | 1128 | { |
1122 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1129 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1127,7 +1134,9 @@ run (void *cls, | |||
1127 | helper_argv[3] = ipv6prefix; | 1134 | helper_argv[3] = ipv6prefix; |
1128 | 1135 | ||
1129 | if (GNUNET_SYSERR == | 1136 | if (GNUNET_SYSERR == |
1130 | GNUNET_CONFIGURATION_get_value_string (cfg, "dns", "IPV4ADDR", | 1137 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1138 | "dns", | ||
1139 | "IPV4ADDR", | ||
1131 | &ipv4addr)) | 1140 | &ipv4addr)) |
1132 | { | 1141 | { |
1133 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1142 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/dv/dv.conf.in b/src/dv/dv.conf.in index 5d9a960f5..145c58be6 100644 --- a/src/dv/dv.conf.in +++ b/src/dv/dv.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [dv] | 1 | [dv] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | ACCEPT_FROM6 = ::1; | 3 | ACCEPT_FROM6 = ::1; |
4 | ACCEPT_FROM = 127.0.0.1; | 4 | ACCEPT_FROM = 127.0.0.1; |
5 | BINARY = gnunet-service-dv | 5 | BINARY = gnunet-service-dv |
diff --git a/src/dv/test_transport_dv_data.conf b/src/dv/test_transport_dv_data.conf index ff02d4a5e..307921ac4 100644 --- a/src/dv/test_transport_dv_data.conf +++ b/src/dv/test_transport_dv_data.conf | |||
@@ -6,11 +6,11 @@ PLUGINS = tcp dv | |||
6 | #PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high | 6 | #PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high |
7 | 7 | ||
8 | [dv] | 8 | [dv] |
9 | AUTOSTART = YES | 9 | START_ON_DEMAND = YES |
10 | # PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high | 10 | # PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high |
11 | 11 | ||
12 | [set] | 12 | [set] |
13 | AUTOSTART = YES | 13 | START_ON_DEMAND = YES |
14 | # PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high | 14 | # PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high |
15 | 15 | ||
16 | [core] | 16 | [core] |
diff --git a/src/fragmentation/test_fragmentation_data.conf b/src/fragmentation/test_fragmentation_data.conf index c236f689c..54ad21ff9 100644 --- a/src/fragmentation/test_fragmentation_data.conf +++ b/src/fragmentation/test_fragmentation_data.conf | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | [nse] | 2 | [nse] |
3 | AUTOSTART = NO | 3 | START_ON_DEMAND = NO |
4 | 4 | ||
5 | 5 | ||
diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in index d46de387f..92bcf776d 100644 --- a/src/fs/fs.conf.in +++ b/src/fs/fs.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [fs] | 1 | [fs] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | FORCESTART = YES | 3 | IMMEDIATE_START = YES |
4 | INDEXDB = $GNUNET_DATA_HOME/fs/idxinfo.lst | 4 | INDEXDB = $GNUNET_DATA_HOME/fs/idxinfo.lst |
5 | RESPECT = $GNUNET_DATA_HOME/fs/credit/ | 5 | RESPECT = $GNUNET_DATA_HOME/fs/credit/ |
6 | STATE_DIR = $GNUNET_DATA_HOME/fs/persistence/ | 6 | STATE_DIR = $GNUNET_DATA_HOME/fs/persistence/ |
@@ -61,7 +61,7 @@ MAX_CADET_CLIENTS = 128 | |||
61 | 61 | ||
62 | [gnunet-auto-share] | 62 | [gnunet-auto-share] |
63 | BINARY = gnunet-auto-share | 63 | BINARY = gnunet-auto-share |
64 | FORCESTART = NO | 64 | IMMEDIATE_START = NO |
65 | 65 | ||
66 | # Note: MUST specify path to auto-share directory and CAN specify other options | 66 | # Note: MUST specify path to auto-share directory and CAN specify other options |
67 | # to gnunet-auto-share here! | 67 | # to gnunet-auto-share here! |
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 0857110b1..9b783ba93 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -3112,7 +3112,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
3112 | ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS; | 3112 | ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS; |
3113 | ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */ | 3113 | ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */ |
3114 | va_start (ap, flags); | 3114 | va_start (ap, flags); |
3115 | while (GNUNET_FS_OPTIONS_END != (opt = va_arg (ap, enum GNUNET_FS_OPTIONS))) | 3115 | while (GNUNET_FS_OPTIONS_END != (opt = GNUNET_VA_ARG_ENUM (ap,GNUNET_FS_OPTIONS))) |
3116 | { | 3116 | { |
3117 | switch (opt) | 3117 | switch (opt) |
3118 | { | 3118 | { |
diff --git a/src/fs/fs_test_lib_data.conf b/src/fs/fs_test_lib_data.conf index 01cac95b8..c99674798 100644 --- a/src/fs/fs_test_lib_data.conf +++ b/src/fs/fs_test_lib_data.conf | |||
@@ -11,7 +11,7 @@ QUOTA = 2 GB | |||
11 | #PLUGIN = heap | 11 | #PLUGIN = heap |
12 | # | 12 | # |
13 | [fs] | 13 | [fs] |
14 | FORCESTART = YES | 14 | IMMEDIATE_START = YES |
15 | 15 | ||
16 | [testbed] | 16 | [testbed] |
17 | OVERLAY_TOPOLOGY = CLIQUE | 17 | OVERLAY_TOPOLOGY = CLIQUE |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 8c431532f..f1a115cb6 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1601,7 +1601,7 @@ called_from_on_demand: | |||
1601 | GNUNET_BLOCK_get_key (GSF_block_ctx, type, data, size, &query)) | 1601 | GNUNET_BLOCK_get_key (GSF_block_ctx, type, data, size, &query)) |
1602 | { | 1602 | { |
1603 | GNUNET_break (0); | 1603 | GNUNET_break (0); |
1604 | GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, -1, -1, | 1604 | GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, UINT_MAX, UINT_MAX, |
1605 | NULL, NULL); | 1605 | NULL, NULL); |
1606 | start_local_query (pr, | 1606 | start_local_query (pr, |
1607 | uid + 1 /* next_uid */, | 1607 | uid + 1 /* next_uid */, |
diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in index e3a8db141..906282200 100755 --- a/src/fs/test_gnunet_fs_psd.py.in +++ b/src/fs/test_gnunet_fs_psd.py.in | |||
@@ -22,16 +22,23 @@ import subprocess | |||
22 | import re | 22 | import re |
23 | import shutil | 23 | import shutil |
24 | try: | 24 | try: |
25 | # Python 2.7 | ||
25 | reload | 26 | reload |
26 | except NameError: | 27 | except NameError: |
27 | # python3.4: | 28 | try: |
28 | from importlib import reload | 29 | # Python 3.4+: |
30 | from importlib import reload | ||
31 | except ImportError: | ||
32 | # Python 3.0 - 3.3 | ||
33 | from imp import reload | ||
29 | 34 | ||
35 | reload(sys) | ||
30 | 36 | ||
31 | # Force encoding to utf-8, as this test otherwise fails | 37 | # Force encoding to utf-8, as this test otherwise fails |
32 | # on some systems (see #5094). | 38 | # on some systems (see #5094). In Python 3+ there is no attribute |
33 | reload(sys) | 39 | # sys.setdefaultencoding anymore. |
34 | sys.setdefaultencoding('utf8') | 40 | if (3 < sys.version_info[0]): |
41 | sys.setdefaultencoding('utf8') | ||
35 | 42 | ||
36 | srcdir = "../.." | 43 | srcdir = "../.." |
37 | gnunet_pyexpect_dir = os.path.join(srcdir, "contrib/scripts") | 44 | gnunet_pyexpect_dir = os.path.join(srcdir, "contrib/scripts") |
@@ -53,6 +60,12 @@ elif os.name == 'nt': | |||
53 | unindex = './gnunet-unindex.exe' | 60 | unindex = './gnunet-unindex.exe' |
54 | search = './gnunet-search.exe' | 61 | search = './gnunet-search.exe' |
55 | 62 | ||
63 | if "GNUNET_PREFIX" in os.environ: | ||
64 | pass | ||
65 | else: | ||
66 | print("You need to export GNUNET_PREFIX") | ||
67 | sys.exit(1) | ||
68 | |||
56 | if os.name == "nt": | 69 | if os.name == "nt": |
57 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True) | 70 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True) |
58 | else: | 71 | else: |
diff --git a/src/gns/gns-helper-service-w32.conf b/src/gns/gns-helper-service-w32.conf index 48652173a..a7b9fdd70 100644 --- a/src/gns/gns-helper-service-w32.conf +++ b/src/gns/gns-helper-service-w32.conf | |||
@@ -1,4 +1,4 @@ | |||
1 | [gns-helper-service-w32] | 1 | [gns-helper-service-w32] |
2 | AUTOSTART = YES | 2 | START_ON_DEMAND = YES |
3 | BINARY = gnunet-gns-helper-service-w32 | 3 | BINARY = gnunet-gns-helper-service-w32 |
4 | PORT = 5353 | 4 | PORT = 5353 |
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in index f7682cda7..2e6a02b07 100644 --- a/src/gns/gns.conf.in +++ b/src/gns/gns.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [gns] | 1 | [gns] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | FORCESTART = YES | 3 | IMMEDIATE_START = YES |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-gns | 5 | BINARY = gnunet-service-gns |
6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-gns.sock | 6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-gns.sock |
@@ -20,7 +20,7 @@ MAX_PARALLEL_BACKGROUND_QUERIES = 1000 | |||
20 | # we will ask gnunet-service-dns to pass DNS queries to us. Otherwise, | 20 | # we will ask gnunet-service-dns to pass DNS queries to us. Otherwise, |
21 | # we only answer GNS queries via the API (which itself may be | 21 | # we only answer GNS queries via the API (which itself may be |
22 | # called via NSS or other mechanisms). | 22 | # called via NSS or other mechanisms). |
23 | INTERCEPT_DNS = YES | 23 | INTERCEPT_DNS = NO |
24 | 24 | ||
25 | # PREFIX = valgrind --leak-check=full --track-origins=yes | 25 | # PREFIX = valgrind --leak-check=full --track-origins=yes |
26 | 26 | ||
@@ -30,8 +30,8 @@ INTERCEPT_DNS = YES | |||
30 | 30 | ||
31 | [gns-proxy] | 31 | [gns-proxy] |
32 | BINARY = gnunet-gns-proxy | 32 | BINARY = gnunet-gns-proxy |
33 | AUTOSTART = NO | 33 | START_ON_DEMAND = NO |
34 | USER_SERVICE = YES | 34 | RUN_PER_USER = YES |
35 | 35 | ||
36 | # Where is the certificate for the GNS proxy stored? | 36 | # Where is the certificate for the GNS proxy stored? |
37 | PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem | 37 | PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem |
@@ -40,8 +40,8 @@ PROXY_UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gns-proxy.sock | |||
40 | 40 | ||
41 | [dns2gns] | 41 | [dns2gns] |
42 | BINARY = gnunet-dns2gns | 42 | BINARY = gnunet-dns2gns |
43 | AUTOSTART = NO | 43 | START_ON_DEMAND = NO |
44 | USER_SERVICE = YES | 44 | RUN_PER_USER = YES |
45 | 45 | ||
46 | # -d: DNS resolver to use, -s: suffix to use, -f: fcfs suffix to use | 46 | # -d: DNS resolver to use, -s: suffix to use, -f: fcfs suffix to use |
47 | OPTIONS = -d 8.8.8.8 | 47 | OPTIONS = -d 8.8.8.8 |
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 8264bf715..0ec9209da 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -300,17 +300,21 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle) | |||
300 | * Cancel pending lookup request | 300 | * Cancel pending lookup request |
301 | * | 301 | * |
302 | * @param lr the lookup request to cancel | 302 | * @param lr the lookup request to cancel |
303 | * @return closure from the lookup result processor | ||
303 | */ | 304 | */ |
304 | void | 305 | void * |
305 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr) | 306 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr) |
306 | { | 307 | { |
307 | struct GNUNET_GNS_Handle *handle = lr->gns_handle; | 308 | struct GNUNET_GNS_Handle *handle = lr->gns_handle; |
309 | void *ret; | ||
308 | 310 | ||
309 | GNUNET_CONTAINER_DLL_remove (handle->lookup_head, | 311 | GNUNET_CONTAINER_DLL_remove (handle->lookup_head, |
310 | handle->lookup_tail, | 312 | handle->lookup_tail, |
311 | lr); | 313 | lr); |
312 | GNUNET_MQ_discard (lr->env); | 314 | GNUNET_MQ_discard (lr->env); |
315 | ret = lr->proc_cls; | ||
313 | GNUNET_free (lr); | 316 | GNUNET_free (lr); |
317 | return ret; | ||
314 | } | 318 | } |
315 | 319 | ||
316 | 320 | ||
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c index b053aa0c1..825b51d06 100644 --- a/src/gns/gns_tld_api.c +++ b/src/gns/gns_tld_api.c | |||
@@ -317,10 +317,13 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, | |||
317 | * Cancel pending lookup request | 317 | * Cancel pending lookup request |
318 | * | 318 | * |
319 | * @param ltr the lookup request to cancel | 319 | * @param ltr the lookup request to cancel |
320 | * @return closure from the lookup result processor | ||
320 | */ | 321 | */ |
321 | void | 322 | void * |
322 | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr) | 323 | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr) |
323 | { | 324 | { |
325 | void *ret = ltr->lookup_proc_cls; | ||
326 | |||
324 | if (NULL != ltr->id_op) | 327 | if (NULL != ltr->id_op) |
325 | { | 328 | { |
326 | GNUNET_IDENTITY_ego_lookup_cancel (ltr->id_op); | 329 | GNUNET_IDENTITY_ego_lookup_cancel (ltr->id_op); |
@@ -333,6 +336,7 @@ GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr) | |||
333 | } | 336 | } |
334 | GNUNET_free (ltr->name); | 337 | GNUNET_free (ltr->name); |
335 | GNUNET_free (ltr); | 338 | GNUNET_free (ltr); |
339 | return ret; | ||
336 | } | 340 | } |
337 | 341 | ||
338 | /* end of gns_tld_api.c */ | 342 | /* end of gns_tld_api.c */ |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 9a405c49b..d66f5c658 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2012-2014 GNUnet e.V. | 3 | Copyright (C) 2012-2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -46,14 +46,6 @@ | |||
46 | #include "gns.h" | 46 | #include "gns.h" |
47 | 47 | ||
48 | 48 | ||
49 | /** | ||
50 | * FIXME: GnuTLS right now sometimes rejects valid certs, so as a | ||
51 | * VERY temporary workaround we just WARN the user instead of | ||
52 | * dropping the page. THIS SHOULD NOT BE USED IN PRODUCTION, | ||
53 | * set to 1 in production!!! FIXME!!! | ||
54 | */ | ||
55 | #define FIXED_CERT_VALIDATION_BUG 0 | ||
56 | |||
57 | 49 | ||
58 | /** | 50 | /** |
59 | * Default Socks5 listen port. | 51 | * Default Socks5 listen port. |
@@ -1079,10 +1071,8 @@ check_ssl_certificate (struct Socks5Request *s5r) | |||
1079 | certdn, | 1071 | certdn, |
1080 | name, | 1072 | name, |
1081 | rc); | 1073 | rc); |
1082 | #if FIXED_CERT_VALIDATION_BUG | ||
1083 | gnutls_x509_crt_deinit (x509_cert); | 1074 | gnutls_x509_crt_deinit (x509_cert); |
1084 | return GNUNET_SYSERR; | 1075 | return GNUNET_SYSERR; |
1085 | #endif | ||
1086 | } | 1076 | } |
1087 | } | 1077 | } |
1088 | else | 1078 | else |
@@ -1197,6 +1187,15 @@ curl_check_hdr (void *buffer, | |||
1197 | s5r->domain); | 1187 | s5r->domain); |
1198 | continue; | 1188 | continue; |
1199 | } | 1189 | } |
1190 | else if ( ('.' == cookie_domain[0]) && | ||
1191 | (0 == strcmp (&cookie_domain[1], | ||
1192 | s5r->leho)) ) | ||
1193 | { | ||
1194 | offset += sprintf (new_cookie_hdr + offset, | ||
1195 | " domain=.%s;", | ||
1196 | s5r->domain); | ||
1197 | continue; | ||
1198 | } | ||
1200 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1199 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1201 | _("Cookie domain `%s' supplied by server is invalid\n"), | 1200 | _("Cookie domain `%s' supplied by server is invalid\n"), |
1202 | tok); | 1201 | tok); |
@@ -1723,12 +1722,6 @@ con_val_iter (void *cls, | |||
1723 | key)) && | 1722 | key)) && |
1724 | (NULL != s5r->leho) ) | 1723 | (NULL != s5r->leho) ) |
1725 | value = s5r->leho; | 1724 | value = s5r->leho; |
1726 | if (0 == strcasecmp (MHD_HTTP_HEADER_CONTENT_LENGTH, | ||
1727 | key)) | ||
1728 | return MHD_YES; | ||
1729 | if (0 == strcasecmp (MHD_HTTP_HEADER_ACCEPT_ENCODING, | ||
1730 | key)) | ||
1731 | return MHD_YES; | ||
1732 | GNUNET_asprintf (&hdr, | 1725 | GNUNET_asprintf (&hdr, |
1733 | "%s: %s", | 1726 | "%s: %s", |
1734 | key, | 1727 | key, |
@@ -1955,7 +1948,7 @@ create_response (void *cls, | |||
1955 | s5r); | 1948 | s5r); |
1956 | { | 1949 | { |
1957 | const char *us; | 1950 | const char *us; |
1958 | long upload_size; | 1951 | long upload_size = 0; |
1959 | 1952 | ||
1960 | us = MHD_lookup_connection_value (con, | 1953 | us = MHD_lookup_connection_value (con, |
1961 | MHD_HEADER_KIND, | 1954 | MHD_HEADER_KIND, |
@@ -1996,7 +1989,8 @@ create_response (void *cls, | |||
1996 | us = MHD_lookup_connection_value (con, | 1989 | us = MHD_lookup_connection_value (con, |
1997 | MHD_HEADER_KIND, | 1990 | MHD_HEADER_KIND, |
1998 | MHD_HTTP_HEADER_CONTENT_LENGTH); | 1991 | MHD_HTTP_HEADER_CONTENT_LENGTH); |
1999 | if ( (NULL != us) && (1 == sscanf (us, | 1992 | if ( (NULL != us) && |
1993 | (1 == sscanf (us, | ||
2000 | "%ld", | 1994 | "%ld", |
2001 | &upload_size)) && | 1995 | &upload_size)) && |
2002 | (upload_size >= 0) ) | 1996 | (upload_size >= 0) ) |
@@ -2026,20 +2020,41 @@ create_response (void *cls, | |||
2026 | curl_easy_setopt (s5r->curl, | 2020 | curl_easy_setopt (s5r->curl, |
2027 | CURLOPT_CUSTOMREQUEST, | 2021 | CURLOPT_CUSTOMREQUEST, |
2028 | "OPTIONS"); | 2022 | "OPTIONS"); |
2023 | curl_easy_setopt (s5r->curl, | ||
2024 | CURLOPT_WRITEFUNCTION, | ||
2025 | &curl_download_cb); | ||
2026 | curl_easy_setopt (s5r->curl, | ||
2027 | CURLOPT_WRITEDATA, | ||
2028 | s5r); | ||
2029 | |||
2029 | } | 2030 | } |
2030 | else if (0 == strcasecmp (meth, | 2031 | else if (0 == strcasecmp (meth, |
2031 | MHD_HTTP_METHOD_GET)) | 2032 | MHD_HTTP_METHOD_GET)) |
2032 | { | 2033 | { |
2033 | s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED; | 2034 | s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED; |
2034 | curl_easy_setopt (s5r->curl, | 2035 | curl_easy_setopt (s5r->curl, |
2035 | CURLOPT_HTTPGET, | 2036 | CURLOPT_HTTPGET, |
2036 | 1L); | 2037 | 1L); |
2037 | curl_easy_setopt (s5r->curl, | 2038 | curl_easy_setopt (s5r->curl, |
2038 | CURLOPT_WRITEFUNCTION, | 2039 | CURLOPT_WRITEFUNCTION, |
2039 | &curl_download_cb); | 2040 | &curl_download_cb); |
2040 | curl_easy_setopt (s5r->curl, | 2041 | curl_easy_setopt (s5r->curl, |
2041 | CURLOPT_WRITEDATA, | 2042 | CURLOPT_WRITEDATA, |
2042 | s5r); | 2043 | s5r); |
2044 | } | ||
2045 | else if (0 == strcasecmp (meth, | ||
2046 | MHD_HTTP_METHOD_DELETE)) | ||
2047 | { | ||
2048 | s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED; | ||
2049 | curl_easy_setopt (s5r->curl, | ||
2050 | CURLOPT_CUSTOMREQUEST, | ||
2051 | "DELETE"); | ||
2052 | curl_easy_setopt (s5r->curl, | ||
2053 | CURLOPT_WRITEFUNCTION, | ||
2054 | &curl_download_cb); | ||
2055 | curl_easy_setopt (s5r->curl, | ||
2056 | CURLOPT_WRITEDATA, | ||
2057 | s5r); | ||
2043 | } | 2058 | } |
2044 | else | 2059 | else |
2045 | { | 2060 | { |
@@ -2054,46 +2069,46 @@ create_response (void *cls, | |||
2054 | if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_0)) | 2069 | if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_0)) |
2055 | { | 2070 | { |
2056 | curl_easy_setopt (s5r->curl, | 2071 | curl_easy_setopt (s5r->curl, |
2057 | CURLOPT_HTTP_VERSION, | 2072 | CURLOPT_HTTP_VERSION, |
2058 | CURL_HTTP_VERSION_1_0); | 2073 | CURL_HTTP_VERSION_1_0); |
2059 | } | 2074 | } |
2060 | else if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_1)) | 2075 | else if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_1)) |
2061 | { | 2076 | { |
2062 | curl_easy_setopt (s5r->curl, | 2077 | curl_easy_setopt (s5r->curl, |
2063 | CURLOPT_HTTP_VERSION, | 2078 | CURLOPT_HTTP_VERSION, |
2064 | CURL_HTTP_VERSION_1_1); | 2079 | CURL_HTTP_VERSION_1_1); |
2065 | } | 2080 | } |
2066 | else | 2081 | else |
2067 | { | 2082 | { |
2068 | curl_easy_setopt (s5r->curl, | 2083 | curl_easy_setopt (s5r->curl, |
2069 | CURLOPT_HTTP_VERSION, | 2084 | CURLOPT_HTTP_VERSION, |
2070 | CURL_HTTP_VERSION_NONE); | 2085 | CURL_HTTP_VERSION_NONE); |
2071 | } | 2086 | } |
2072 | 2087 | ||
2073 | if (HTTPS_PORT == s5r->port) | 2088 | if (HTTPS_PORT == s5r->port) |
2074 | { | 2089 | { |
2075 | curl_easy_setopt (s5r->curl, | 2090 | curl_easy_setopt (s5r->curl, |
2076 | CURLOPT_USE_SSL, | 2091 | CURLOPT_USE_SSL, |
2077 | CURLUSESSL_ALL); | 2092 | CURLUSESSL_ALL); |
2078 | if (NULL != s5r->dane_data) | 2093 | if (NULL != s5r->dane_data) |
2079 | curl_easy_setopt (s5r->curl, | 2094 | curl_easy_setopt (s5r->curl, |
2080 | CURLOPT_SSL_VERIFYPEER, | 2095 | CURLOPT_SSL_VERIFYPEER, |
2081 | 0L); | 2096 | 0L); |
2082 | else | 2097 | else |
2083 | curl_easy_setopt (s5r->curl, | 2098 | curl_easy_setopt (s5r->curl, |
2084 | CURLOPT_SSL_VERIFYPEER, | 2099 | CURLOPT_SSL_VERIFYPEER, |
2085 | 1L); | 2100 | 1L); |
2086 | /* Disable cURL checking the hostname, as we will check ourselves | 2101 | /* Disable cURL checking the hostname, as we will check ourselves |
2087 | as only we have the domain name or the LEHO or the DANE record */ | 2102 | as only we have the domain name or the LEHO or the DANE record */ |
2088 | curl_easy_setopt (s5r->curl, | 2103 | curl_easy_setopt (s5r->curl, |
2089 | CURLOPT_SSL_VERIFYHOST, | 2104 | CURLOPT_SSL_VERIFYHOST, |
2090 | 0L); | 2105 | 0L); |
2091 | } | 2106 | } |
2092 | else | 2107 | else |
2093 | { | 2108 | { |
2094 | curl_easy_setopt (s5r->curl, | 2109 | curl_easy_setopt (s5r->curl, |
2095 | CURLOPT_USE_SSL, | 2110 | CURLOPT_USE_SSL, |
2096 | CURLUSESSL_NONE); | 2111 | CURLUSESSL_NONE); |
2097 | } | 2112 | } |
2098 | 2113 | ||
2099 | if (CURLM_OK != | 2114 | if (CURLM_OK != |
@@ -2121,14 +2136,14 @@ create_response (void *cls, | |||
2121 | { | 2136 | { |
2122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2137 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2123 | "Processing %u bytes UPLOAD\n", | 2138 | "Processing %u bytes UPLOAD\n", |
2124 | (unsigned int) *upload_data_size); | 2139 | (unsigned int) *upload_data_size); |
2125 | 2140 | ||
2126 | /* FIXME: This must be set or a header with Transfer-Encoding: chunked. Else | 2141 | /* FIXME: This must be set or a header with Transfer-Encoding: chunked. Else |
2127 | * upload callback is not called! | 2142 | * upload callback is not called! |
2128 | */ | 2143 | */ |
2129 | curl_easy_setopt (s5r->curl, | 2144 | curl_easy_setopt (s5r->curl, |
2130 | CURLOPT_POSTFIELDSIZE, | 2145 | CURLOPT_POSTFIELDSIZE, |
2131 | *upload_data_size); | 2146 | *upload_data_size); |
2132 | 2147 | ||
2133 | left = GNUNET_MIN (*upload_data_size, | 2148 | left = GNUNET_MIN (*upload_data_size, |
2134 | sizeof (s5r->io_buf) - s5r->io_len); | 2149 | sizeof (s5r->io_buf) - s5r->io_len); |
@@ -2142,7 +2157,7 @@ create_response (void *cls, | |||
2142 | { | 2157 | { |
2143 | s5r->curl_paused = GNUNET_NO; | 2158 | s5r->curl_paused = GNUNET_NO; |
2144 | curl_easy_pause (s5r->curl, | 2159 | curl_easy_pause (s5r->curl, |
2145 | CURLPAUSE_CONT); | 2160 | CURLPAUSE_CONT); |
2146 | } | 2161 | } |
2147 | return MHD_YES; | 2162 | return MHD_YES; |
2148 | } | 2163 | } |
@@ -2522,9 +2537,9 @@ load_file (const char* filename, | |||
2522 | 2537 | ||
2523 | if (GNUNET_OK != | 2538 | if (GNUNET_OK != |
2524 | GNUNET_DISK_file_size (filename, | 2539 | GNUNET_DISK_file_size (filename, |
2525 | &fsize, | 2540 | &fsize, |
2526 | GNUNET_YES, | 2541 | GNUNET_YES, |
2527 | GNUNET_YES)) | 2542 | GNUNET_YES)) |
2528 | return NULL; | 2543 | return NULL; |
2529 | if (fsize > MAX_PEM_SIZE) | 2544 | if (fsize > MAX_PEM_SIZE) |
2530 | return NULL; | 2545 | return NULL; |
@@ -2557,7 +2572,7 @@ load_key_from_file (gnutls_x509_privkey_t key, | |||
2557 | int ret; | 2572 | int ret; |
2558 | 2573 | ||
2559 | key_data.data = load_file (keyfile, | 2574 | key_data.data = load_file (keyfile, |
2560 | &key_data.size); | 2575 | &key_data.size); |
2561 | if (NULL == key_data.data) | 2576 | if (NULL == key_data.data) |
2562 | return GNUNET_SYSERR; | 2577 | return GNUNET_SYSERR; |
2563 | ret = gnutls_x509_privkey_import (key, &key_data, | 2578 | ret = gnutls_x509_privkey_import (key, &key_data, |
@@ -2588,17 +2603,17 @@ load_cert_from_file (gnutls_x509_crt_t crt, | |||
2588 | int ret; | 2603 | int ret; |
2589 | 2604 | ||
2590 | cert_data.data = load_file (certfile, | 2605 | cert_data.data = load_file (certfile, |
2591 | &cert_data.size); | 2606 | &cert_data.size); |
2592 | if (NULL == cert_data.data) | 2607 | if (NULL == cert_data.data) |
2593 | return GNUNET_SYSERR; | 2608 | return GNUNET_SYSERR; |
2594 | ret = gnutls_x509_crt_import (crt, | 2609 | ret = gnutls_x509_crt_import (crt, |
2595 | &cert_data, | 2610 | &cert_data, |
2596 | GNUTLS_X509_FMT_PEM); | 2611 | GNUTLS_X509_FMT_PEM); |
2597 | if (GNUTLS_E_SUCCESS != ret) | 2612 | if (GNUTLS_E_SUCCESS != ret) |
2598 | { | 2613 | { |
2599 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2614 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2600 | _("Unable to import certificate from `%s'\n"), | 2615 | _("Unable to import certificate from `%s'\n"), |
2601 | certfile); | 2616 | certfile); |
2602 | } | 2617 | } |
2603 | GNUNET_free_non_null (cert_data.data); | 2618 | GNUNET_free_non_null (cert_data.data); |
2604 | return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; | 2619 | return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; |
@@ -2629,26 +2644,26 @@ generate_gns_certificate (const char *name) | |||
2629 | GNUNET_break (GNUTLS_E_SUCCESS == gnutls_x509_crt_set_key (request, proxy_ca.key)); | 2644 | GNUNET_break (GNUTLS_E_SUCCESS == gnutls_x509_crt_set_key (request, proxy_ca.key)); |
2630 | pgc = GNUNET_new (struct ProxyGNSCertificate); | 2645 | pgc = GNUNET_new (struct ProxyGNSCertificate); |
2631 | gnutls_x509_crt_set_dn_by_oid (request, | 2646 | gnutls_x509_crt_set_dn_by_oid (request, |
2632 | GNUTLS_OID_X520_COUNTRY_NAME, | 2647 | GNUTLS_OID_X520_COUNTRY_NAME, |
2633 | 0, | 2648 | 0, |
2634 | "ZZ", | 2649 | "ZZ", |
2635 | strlen ("ZZ")); | 2650 | strlen ("ZZ")); |
2636 | gnutls_x509_crt_set_dn_by_oid (request, | 2651 | gnutls_x509_crt_set_dn_by_oid (request, |
2637 | GNUTLS_OID_X520_ORGANIZATION_NAME, | 2652 | GNUTLS_OID_X520_ORGANIZATION_NAME, |
2638 | 0, | 2653 | 0, |
2639 | "GNU Name System", | 2654 | "GNU Name System", |
2640 | strlen ("GNU Name System")); | 2655 | strlen ("GNU Name System")); |
2641 | gnutls_x509_crt_set_dn_by_oid (request, | 2656 | gnutls_x509_crt_set_dn_by_oid (request, |
2642 | GNUTLS_OID_X520_COMMON_NAME, | 2657 | GNUTLS_OID_X520_COMMON_NAME, |
2643 | 0, | 2658 | 0, |
2644 | name, | 2659 | name, |
2645 | strlen (name)); | 2660 | strlen (name)); |
2646 | GNUNET_break (GNUTLS_E_SUCCESS == | 2661 | GNUNET_break (GNUTLS_E_SUCCESS == |
2647 | gnutls_x509_crt_set_version (request, | 2662 | gnutls_x509_crt_set_version (request, |
2648 | 3)); | 2663 | 3)); |
2649 | gnutls_rnd (GNUTLS_RND_NONCE, | 2664 | gnutls_rnd (GNUTLS_RND_NONCE, |
2650 | &serial, | 2665 | &serial, |
2651 | sizeof (serial)); | 2666 | sizeof (serial)); |
2652 | gnutls_x509_crt_set_serial (request, | 2667 | gnutls_x509_crt_set_serial (request, |
2653 | &serial, | 2668 | &serial, |
2654 | sizeof (serial)); | 2669 | sizeof (serial)); |
@@ -2663,20 +2678,20 @@ generate_gns_certificate (const char *name) | |||
2663 | gnutls_x509_crt_set_expiration_time (request, | 2678 | gnutls_x509_crt_set_expiration_time (request, |
2664 | etime); | 2679 | etime); |
2665 | gnutls_x509_crt_sign2 (request, | 2680 | gnutls_x509_crt_sign2 (request, |
2666 | proxy_ca.cert, | 2681 | proxy_ca.cert, |
2667 | proxy_ca.key, | 2682 | proxy_ca.key, |
2668 | GNUTLS_DIG_SHA512, | 2683 | GNUTLS_DIG_SHA512, |
2669 | 0); | 2684 | 0); |
2670 | key_buf_size = sizeof (pgc->key); | 2685 | key_buf_size = sizeof (pgc->key); |
2671 | cert_buf_size = sizeof (pgc->cert); | 2686 | cert_buf_size = sizeof (pgc->cert); |
2672 | gnutls_x509_crt_export (request, | 2687 | gnutls_x509_crt_export (request, |
2673 | GNUTLS_X509_FMT_PEM, | 2688 | GNUTLS_X509_FMT_PEM, |
2674 | pgc->cert, | 2689 | pgc->cert, |
2675 | &cert_buf_size); | 2690 | &cert_buf_size); |
2676 | gnutls_x509_privkey_export (proxy_ca.key, | 2691 | gnutls_x509_privkey_export (proxy_ca.key, |
2677 | GNUTLS_X509_FMT_PEM, | 2692 | GNUTLS_X509_FMT_PEM, |
2678 | pgc->key, | 2693 | pgc->key, |
2679 | &key_buf_size); | 2694 | &key_buf_size); |
2680 | gnutls_x509_crt_deinit (request); | 2695 | gnutls_x509_crt_deinit (request); |
2681 | return pgc; | 2696 | return pgc; |
2682 | } | 2697 | } |
@@ -3120,7 +3135,7 @@ do_s5r_read (void *cls) | |||
3120 | tc = GNUNET_SCHEDULER_get_task_context (); | 3135 | tc = GNUNET_SCHEDULER_get_task_context (); |
3121 | if ( (NULL != tc->read_ready) && | 3136 | if ( (NULL != tc->read_ready) && |
3122 | (GNUNET_NETWORK_fdset_isset (tc->read_ready, | 3137 | (GNUNET_NETWORK_fdset_isset (tc->read_ready, |
3123 | s5r->sock)) ) | 3138 | s5r->sock)) ) |
3124 | { | 3139 | { |
3125 | rlen = GNUNET_NETWORK_socket_recv (s5r->sock, | 3140 | rlen = GNUNET_NETWORK_socket_recv (s5r->sock, |
3126 | &s5r->rbuf[s5r->rbuf_len], | 3141 | &s5r->rbuf[s5r->rbuf_len], |
@@ -3247,7 +3262,7 @@ do_s5r_read (void *cls) | |||
3247 | *dom_len); | 3262 | *dom_len); |
3248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3263 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3249 | "Requested connection is to http%s://%s:%d\n", | 3264 | "Requested connection is to http%s://%s:%d\n", |
3250 | (HTTPS_PORT == s5r->port) ? "s" : "", | 3265 | (HTTPS_PORT == s5r->port) ? "s" : "", |
3251 | s5r->domain, | 3266 | s5r->domain, |
3252 | ntohs (*port)); | 3267 | ntohs (*port)); |
3253 | s5r->state = SOCKS5_RESOLVING; | 3268 | s5r->state = SOCKS5_RESOLVING; |
@@ -3319,21 +3334,21 @@ do_accept (void *cls) | |||
3319 | ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 3334 | ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
3320 | lsock, | 3335 | lsock, |
3321 | &do_accept, | 3336 | &do_accept, |
3322 | lsock); | 3337 | lsock); |
3323 | else if (lsock == lsock6) | 3338 | else if (lsock == lsock6) |
3324 | ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 3339 | ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
3325 | lsock, | 3340 | lsock, |
3326 | &do_accept, | 3341 | &do_accept, |
3327 | lsock); | 3342 | lsock); |
3328 | else | 3343 | else |
3329 | GNUNET_assert (0); | 3344 | GNUNET_assert (0); |
3330 | s = GNUNET_NETWORK_socket_accept (lsock, | 3345 | s = GNUNET_NETWORK_socket_accept (lsock, |
3331 | NULL, | 3346 | NULL, |
3332 | NULL); | 3347 | NULL); |
3333 | if (NULL == s) | 3348 | if (NULL == s) |
3334 | { | 3349 | { |
3335 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, | 3350 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, |
3336 | "accept"); | 3351 | "accept"); |
3337 | return; | 3352 | return; |
3338 | } | 3353 | } |
3339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3354 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -3347,7 +3362,7 @@ do_accept (void *cls) | |||
3347 | s5r->rtask = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 3362 | s5r->rtask = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
3348 | s5r->sock, | 3363 | s5r->sock, |
3349 | &do_s5r_read, | 3364 | &do_s5r_read, |
3350 | s5r); | 3365 | s5r); |
3351 | } | 3366 | } |
3352 | 3367 | ||
3353 | 3368 | ||
@@ -3445,7 +3460,7 @@ bind_v4 () | |||
3445 | return NULL; | 3460 | return NULL; |
3446 | if (GNUNET_OK != | 3461 | if (GNUNET_OK != |
3447 | GNUNET_NETWORK_socket_bind (ls, | 3462 | GNUNET_NETWORK_socket_bind (ls, |
3448 | (const struct sockaddr *) &sa4, | 3463 | (const struct sockaddr *) &sa4, |
3449 | sizeof (sa4))) | 3464 | sizeof (sa4))) |
3450 | { | 3465 | { |
3451 | eno = errno; | 3466 | eno = errno; |
@@ -3482,7 +3497,7 @@ bind_v6 () | |||
3482 | return NULL; | 3497 | return NULL; |
3483 | if (GNUNET_OK != | 3498 | if (GNUNET_OK != |
3484 | GNUNET_NETWORK_socket_bind (ls, | 3499 | GNUNET_NETWORK_socket_bind (ls, |
3485 | (const struct sockaddr *) &sa6, | 3500 | (const struct sockaddr *) &sa6, |
3486 | sizeof (sa6))) | 3501 | sizeof (sa6))) |
3487 | { | 3502 | { |
3488 | eno = errno; | 3503 | eno = errno; |
@@ -3537,8 +3552,8 @@ run (void *cls, | |||
3537 | cafile = cafile_cfg; | 3552 | cafile = cafile_cfg; |
3538 | } | 3553 | } |
3539 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3554 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3540 | "Using `%s' as CA\n", | 3555 | "Using `%s' as CA\n", |
3541 | cafile); | 3556 | cafile); |
3542 | 3557 | ||
3543 | gnutls_global_init (); | 3558 | gnutls_global_init (); |
3544 | gnutls_x509_crt_init (&proxy_ca.cert); | 3559 | gnutls_x509_crt_init (&proxy_ca.cert); |
@@ -3678,19 +3693,19 @@ main (int argc, | |||
3678 | { | 3693 | { |
3679 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 3694 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
3680 | GNUNET_GETOPT_option_uint16 ('p', | 3695 | GNUNET_GETOPT_option_uint16 ('p', |
3681 | "port", | 3696 | "port", |
3682 | NULL, | 3697 | NULL, |
3683 | gettext_noop ("listen on specified port (default: 7777)"), | 3698 | gettext_noop ("listen on specified port (default: 7777)"), |
3684 | &port), | 3699 | &port), |
3685 | GNUNET_GETOPT_option_string ('a', | 3700 | GNUNET_GETOPT_option_string ('a', |
3686 | "authority", | 3701 | "authority", |
3687 | NULL, | 3702 | NULL, |
3688 | gettext_noop ("pem file to use as CA"), | 3703 | gettext_noop ("pem file to use as CA"), |
3689 | &cafile_opt), | 3704 | &cafile_opt), |
3690 | GNUNET_GETOPT_option_flag ('6', | 3705 | GNUNET_GETOPT_option_flag ('6', |
3691 | "disable-ivp6", | 3706 | "disable-ivp6", |
3692 | gettext_noop ("disable use of IPv6"), | 3707 | gettext_noop ("disable use of IPv6"), |
3693 | &disable_v6), | 3708 | &disable_v6), |
3694 | 3709 | ||
3695 | GNUNET_GETOPT_OPTION_END | 3710 | GNUNET_GETOPT_OPTION_END |
3696 | }; | 3711 | }; |
@@ -3701,7 +3716,7 @@ main (int argc, | |||
3701 | 3716 | ||
3702 | if (GNUNET_OK != | 3717 | if (GNUNET_OK != |
3703 | GNUNET_STRINGS_get_utf8_args (argc, argv, | 3718 | GNUNET_STRINGS_get_utf8_args (argc, argv, |
3704 | &argc, &argv)) | 3719 | &argc, &argv)) |
3705 | return 2; | 3720 | return 2; |
3706 | GNUNET_log_setup ("gnunet-gns-proxy", | 3721 | GNUNET_log_setup ("gnunet-gns-proxy", |
3707 | "WARNING", | 3722 | "WARNING", |
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index ecf4d59f5..42f3e1514 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c | |||
@@ -103,7 +103,7 @@ reply_to_dns (void *cls, uint32_t rd_count, | |||
103 | unsigned int num_answers; | 103 | unsigned int num_answers; |
104 | unsigned int skip_answers; | 104 | unsigned int skip_answers; |
105 | unsigned int skip_additional; | 105 | unsigned int skip_additional; |
106 | size_t off; | 106 | size_t off = 0; |
107 | 107 | ||
108 | /* Put records in the DNS packet */ | 108 | /* Put records in the DNS packet */ |
109 | num_answers = 0; | 109 | num_answers = 0; |
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 54c3cba23..67960ef97 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -2397,6 +2397,8 @@ handle_dht_response (void *cls, | |||
2397 | "Received expired block from the DHT, will not cache it.\n"); | 2397 | "Received expired block from the DHT, will not cache it.\n"); |
2398 | return; | 2398 | return; |
2399 | } | 2399 | } |
2400 | if (GNUNET_YES == disable_cache) | ||
2401 | return; | ||
2400 | /* Cache well-formed blocks */ | 2402 | /* Cache well-formed blocks */ |
2401 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2403 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2402 | "Caching response from the DHT in namecache\n"); | 2404 | "Caching response from the DHT in namecache\n"); |
@@ -2407,7 +2409,7 @@ handle_dht_response (void *cls, | |||
2407 | co); | 2409 | co); |
2408 | GNUNET_CONTAINER_DLL_insert (co_head, | 2410 | GNUNET_CONTAINER_DLL_insert (co_head, |
2409 | co_tail, | 2411 | co_tail, |
2410 | co); | 2412 | co); |
2411 | } | 2413 | } |
2412 | 2414 | ||
2413 | 2415 | ||
diff --git a/src/gns/test_gns_lookup.conf b/src/gns/test_gns_lookup.conf index a7b842302..0d9d2b49a 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf | |||
@@ -4,14 +4,14 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [transport] | 9 | [transport] |
10 | PLUGINS = | 10 | PLUGINS = |
11 | 11 | ||
12 | [gns] | 12 | [gns] |
13 | # PREFIX = valgrind --leak-check=full --track-origins=yes | 13 | # PREFIX = valgrind --leak-check=full --track-origins=yes |
14 | AUTOSTART = YES | 14 | START_ON_DEMAND = YES |
15 | AUTO_IMPORT_PKEY = YES | 15 | AUTO_IMPORT_PKEY = YES |
16 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | 16 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 |
17 | DEFAULT_LOOKUP_TIMEOUT = 15 s | 17 | DEFAULT_LOOKUP_TIMEOUT = 15 s |
diff --git a/src/gns/test_gns_nick_shorten.conf b/src/gns/test_gns_nick_shorten.conf index 210159fc8..317477c80 100644 --- a/src/gns/test_gns_nick_shorten.conf +++ b/src/gns/test_gns_nick_shorten.conf | |||
@@ -4,14 +4,14 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [transport] | 9 | [transport] |
10 | PLUGINS = | 10 | PLUGINS = |
11 | 11 | ||
12 | [gns] | 12 | [gns] |
13 | #PREFIX = valgrind --leak-check=full --track-origins=yes | 13 | #PREFIX = valgrind --leak-check=full --track-origins=yes |
14 | AUTOSTART = YES | 14 | START_ON_DEMAND = YES |
15 | AUTO_IMPORT_PKEY = YES | 15 | AUTO_IMPORT_PKEY = YES |
16 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | 16 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 |
17 | DEFAULT_LOOKUP_TIMEOUT = 15 s | 17 | DEFAULT_LOOKUP_TIMEOUT = 15 s |
diff --git a/src/gns/test_gns_proxy.conf b/src/gns/test_gns_proxy.conf index 875c0a5e3..51edd5a0c 100644 --- a/src/gns/test_gns_proxy.conf +++ b/src/gns/test_gns_proxy.conf | |||
@@ -13,7 +13,7 @@ WEAKRANDOM = YES | |||
13 | HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat | 13 | HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat |
14 | 14 | ||
15 | [gns] | 15 | [gns] |
16 | AUTOSTART = YES | 16 | START_ON_DEMAND = YES |
17 | ZONEKEY = $GNUNET_TEST_HOME/.zonekey | 17 | ZONEKEY = $GNUNET_TEST_HOME/.zonekey |
18 | HIJACK_DNS = YES | 18 | HIJACK_DNS = YES |
19 | 19 | ||
@@ -22,7 +22,7 @@ PROXY_CACERT = proxy/test_cert.pem | |||
22 | PROXY_UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gns-proxy.sock | 22 | PROXY_UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gns-proxy.sock |
23 | 23 | ||
24 | [namestore] | 24 | [namestore] |
25 | AUTOSTART = YES | 25 | START_ON_DEMAND = YES |
26 | 26 | ||
27 | [dns] | 27 | [dns] |
28 | PROVIDE_EXIT = NO | 28 | PROVIDE_EXIT = NO |
diff --git a/src/gns/test_gns_simple_lookup.conf b/src/gns/test_gns_simple_lookup.conf index 5bf6f8e63..374731377 100644 --- a/src/gns/test_gns_simple_lookup.conf +++ b/src/gns/test_gns_simple_lookup.conf | |||
@@ -1,13 +1,13 @@ | |||
1 | @INLINE@ test_gns_defaults.conf | 1 | @INLINE@ test_gns_defaults.conf |
2 | [fs] | 2 | [fs] |
3 | AUTOSTART = NO | 3 | START_ON_DEMAND = NO |
4 | 4 | ||
5 | [resolver] | 5 | [resolver] |
6 | AUTOSTART = YES | 6 | START_ON_DEMAND = YES |
7 | HOSTNAME = localhost | 7 | HOSTNAME = localhost |
8 | 8 | ||
9 | [dht] | 9 | [dht] |
10 | AUTOSTART = YES | 10 | START_ON_DEMAND = YES |
11 | ACCEPT_FROM6 = ::1; | 11 | ACCEPT_FROM6 = ::1; |
12 | ACCEPT_FROM = 127.0.0.1; | 12 | ACCEPT_FROM = 127.0.0.1; |
13 | HOSTNAME = localhost | 13 | HOSTNAME = localhost |
@@ -54,12 +54,12 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
54 | USE_LOCALADDR = NO | 54 | USE_LOCALADDR = NO |
55 | 55 | ||
56 | [dns] | 56 | [dns] |
57 | AUTOSTART = YES | 57 | START_ON_DEMAND = YES |
58 | DNS_EXIT = 8.8.8.8 | 58 | DNS_EXIT = 8.8.8.8 |
59 | 59 | ||
60 | [gns] | 60 | [gns] |
61 | #PREFIX = valgrind --leak-check=full --track-origins=yes | 61 | #PREFIX = valgrind --leak-check=full --track-origins=yes |
62 | AUTOSTART = YES | 62 | START_ON_DEMAND = YES |
63 | BINARY = gnunet-service-gns | 63 | BINARY = gnunet-service-gns |
64 | ZONEKEY = zonefiles/test_zonekey | 64 | ZONEKEY = zonefiles/test_zonekey |
65 | PRIVATE_ZONE = private | 65 | PRIVATE_ZONE = private |
@@ -75,14 +75,14 @@ DEFAULT_LOOKUP_TIMEOUT = 15 s | |||
75 | RECORD_PUT_INTERVAL = 1 h | 75 | RECORD_PUT_INTERVAL = 1 h |
76 | 76 | ||
77 | [nse] | 77 | [nse] |
78 | AUTOSTART = NO | 78 | START_ON_DEMAND = NO |
79 | 79 | ||
80 | [statistics] | 80 | [statistics] |
81 | AUTOSTART = NO | 81 | START_ON_DEMAND = NO |
82 | 82 | ||
83 | [namestore] | 83 | [namestore] |
84 | PORT = 22371 | 84 | PORT = 22371 |
85 | AUTOSTART = YES | 85 | START_ON_DEMAND = YES |
86 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-namestore-default.sock | 86 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-namestore-default.sock |
87 | UNIX_MATCH_UID = YES | 87 | UNIX_MATCH_UID = YES |
88 | UNIX_MATCH_GID = YES | 88 | UNIX_MATCH_GID = YES |
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c index adbf02755..a1cfbe984 100644 --- a/src/gnsrecord/gnsrecord_serialization.c +++ b/src/gnsrecord/gnsrecord_serialization.c | |||
@@ -120,6 +120,21 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | |||
120 | GNUNET_break (0); | 120 | GNUNET_break (0); |
121 | return -1; | 121 | return -1; |
122 | } | 122 | } |
123 | //Do not pad PKEY | ||
124 | if (GNUNET_GNSRECORD_TYPE_PKEY == rd->record_type) | ||
125 | return ret; | ||
126 | /** | ||
127 | * Efficiently round up to the next | ||
128 | * power of 2 for padding | ||
129 | * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 | ||
130 | */ | ||
131 | ret--; | ||
132 | ret |= ret >> 1; | ||
133 | ret |= ret >> 2; | ||
134 | ret |= ret >> 4; | ||
135 | ret |= ret >> 8; | ||
136 | ret |= ret >> 16; | ||
137 | ret++; | ||
123 | return (ssize_t) ret; | 138 | return (ssize_t) ret; |
124 | } | 139 | } |
125 | 140 | ||
@@ -135,9 +150,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count, | |||
135 | */ | 150 | */ |
136 | ssize_t | 151 | ssize_t |
137 | GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | 152 | GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, |
138 | const struct GNUNET_GNSRECORD_Data *rd, | 153 | const struct GNUNET_GNSRECORD_Data *rd, |
139 | size_t dest_size, | 154 | size_t dest_size, |
140 | char *dest) | 155 | char *dest) |
141 | { | 156 | { |
142 | struct NetworkRecord rec; | 157 | struct NetworkRecord rec; |
143 | size_t off; | 158 | size_t off; |
@@ -190,7 +205,7 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | |||
190 | } | 205 | } |
191 | #endif | 206 | #endif |
192 | } | 207 | } |
193 | return off; | 208 | return dest_size; |
194 | } | 209 | } |
195 | 210 | ||
196 | 211 | ||
@@ -205,9 +220,9 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, | |||
205 | */ | 220 | */ |
206 | int | 221 | int |
207 | GNUNET_GNSRECORD_records_deserialize (size_t len, | 222 | GNUNET_GNSRECORD_records_deserialize (size_t len, |
208 | const char *src, | 223 | const char *src, |
209 | unsigned int rd_count, | 224 | unsigned int rd_count, |
210 | struct GNUNET_GNSRECORD_Data *dest) | 225 | struct GNUNET_GNSRECORD_Data *dest) |
211 | { | 226 | { |
212 | struct NetworkRecord rec; | 227 | struct NetworkRecord rec; |
213 | size_t off; | 228 | size_t off; |
diff --git a/src/hostlist/hostlist.conf b/src/hostlist/hostlist.conf index 77cd29e73..59cc351cc 100644 --- a/src/hostlist/hostlist.conf +++ b/src/hostlist/hostlist.conf | |||
@@ -1,5 +1,5 @@ | |||
1 | [hostlist] | 1 | [hostlist] |
2 | FORCESTART = YES | 2 | IMMEDIATE_START = YES |
3 | NOARMBIND = YES | 3 | NOARMBIND = YES |
4 | BINARY = gnunet-daemon-hostlist | 4 | BINARY = gnunet-daemon-hostlist |
5 | 5 | ||
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf index f3346b9fc..00c57c1e5 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf | |||
@@ -34,11 +34,11 @@ HTTPPORT = 12980 | |||
34 | HOSTLISTFILE = hostlists_peer1.file | 34 | HOSTLISTFILE = hostlists_peer1.file |
35 | OPTIONS = -b -p | 35 | OPTIONS = -b -p |
36 | SERVERS = http://localhost:22981/ | 36 | SERVERS = http://localhost:22981/ |
37 | FORCESTART = YES | 37 | IMMEDIATE_START = YES |
38 | 38 | ||
39 | [ats] | 39 | [ats] |
40 | PORT = 12971 | 40 | PORT = 12971 |
41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-ats.sock | 41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-ats.sock |
42 | 42 | ||
43 | [topology] | 43 | [topology] |
44 | FORCESTART = YES \ No newline at end of file | 44 | IMMEDIATE_START = YES |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf index 95fb7ea1b..6bcd63fe7 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf | |||
@@ -34,11 +34,11 @@ HTTPPORT = 22981 | |||
34 | HOSTLISTFILE = hostlists_peer2.file | 34 | HOSTLISTFILE = hostlists_peer2.file |
35 | OPTIONS = -b -p | 35 | OPTIONS = -b -p |
36 | SERVERS = http://localhost:12980/ | 36 | SERVERS = http://localhost:12980/ |
37 | FORCESTART = YES | 37 | IMMEDIATE_START = YES |
38 | 38 | ||
39 | [ats] | 39 | [ats] |
40 | PORT = 22971 | 40 | PORT = 22971 |
41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-ats.sock | 41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-ats.sock |
42 | 42 | ||
43 | [topology] | 43 | [topology] |
44 | FORCESTART = YES | 44 | IMMEDIATE_START = YES |
diff --git a/src/hostlist/test_learning_adv_peer.conf b/src/hostlist/test_learning_adv_peer.conf index 11c846634..3bee3c0c7 100644 --- a/src/hostlist/test_learning_adv_peer.conf +++ b/src/hostlist/test_learning_adv_peer.conf | |||
@@ -35,11 +35,11 @@ HOSTLISTFILE = hostlists_adv_peer.file | |||
35 | OPTIONS = -p -a | 35 | OPTIONS = -p -a |
36 | SERVERS = http://localhost:12981/ | 36 | SERVERS = http://localhost:12981/ |
37 | EXTERNAL_DNS_NAME = localhost | 37 | EXTERNAL_DNS_NAME = localhost |
38 | FORCESTART = YES | 38 | IMMEDIATE_START = YES |
39 | 39 | ||
40 | [ats] | 40 | [ats] |
41 | PORT = 22971 | 41 | PORT = 22971 |
42 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p2-service-core.sock | 42 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p2-service-core.sock |
43 | 43 | ||
44 | [topology] | 44 | [topology] |
45 | FORCESTART = YES | 45 | IMMEDIATE_START = YES |
diff --git a/src/hostlist/test_learning_learn_peer.conf b/src/hostlist/test_learning_learn_peer.conf index 76585dbbd..0dafe6302 100644 --- a/src/hostlist/test_learning_learn_peer.conf +++ b/src/hostlist/test_learning_learn_peer.conf | |||
@@ -34,11 +34,11 @@ HTTPPORT = 12980 | |||
34 | HOSTLISTFILE = hostlists_learn_peer.file | 34 | HOSTLISTFILE = hostlists_learn_peer.file |
35 | OPTIONS = -b -e | 35 | OPTIONS = -b -e |
36 | SERVERS = http://localhost:12981/ | 36 | SERVERS = http://localhost:12981/ |
37 | FORCESTART = YES | 37 | IMMEDIATE_START = YES |
38 | 38 | ||
39 | [ats] | 39 | [ats] |
40 | PORT = 12971 | 40 | PORT = 12971 |
41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p1-service-core.sock | 41 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p1-service-core.sock |
42 | 42 | ||
43 | [topology] | 43 | [topology] |
44 | FORCESTART = YES | 44 | IMMEDIATE_START = YES |
diff --git a/src/hostlist/test_learning_learn_peer2.conf b/src/hostlist/test_learning_learn_peer2.conf index 593744cdc..dc2956dcc 100644 --- a/src/hostlist/test_learning_learn_peer2.conf +++ b/src/hostlist/test_learning_learn_peer2.conf | |||
@@ -34,7 +34,7 @@ HTTPPORT = 32980 | |||
34 | HOSTLISTFILE = hostlists_learn_peer2.file | 34 | HOSTLISTFILE = hostlists_learn_peer2.file |
35 | OPTIONS = -b -e | 35 | OPTIONS = -b -e |
36 | SERVERS = http://localhost:12981/ | 36 | SERVERS = http://localhost:12981/ |
37 | FORCESTART = YES | 37 | IMMEDIATE_START = YES |
38 | 38 | ||
39 | [topology] | 39 | [topology] |
40 | FORCESTART = YES | 40 | IMMEDIATE_START = YES |
diff --git a/src/identity-provider/identity-provider.conf b/src/identity-provider/identity-provider.conf index f2c24c32d..cc50152a1 100644 --- a/src/identity-provider/identity-provider.conf +++ b/src/identity-provider/identity-provider.conf | |||
@@ -1,6 +1,6 @@ | |||
1 | [identity-provider] | 1 | [identity-provider] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | USER_SERVICE = YES | 3 | RUN_PER_USER = YES |
4 | #PORT = 2108 | 4 | #PORT = 2108 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-identity-provider | 6 | BINARY = gnunet-service-identity-provider |
diff --git a/src/identity-provider/test_idp.conf b/src/identity-provider/test_idp.conf index 3559dd767..3e4df561a 100644 --- a/src/identity-provider/test_idp.conf +++ b/src/identity-provider/test_idp.conf | |||
@@ -4,22 +4,22 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-idp-peer-1/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-idp-peer-1/ |
5 | 5 | ||
6 | [dht] | 6 | [dht] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [rest] | 9 | [rest] |
10 | AUTOSTART = YES | 10 | START_ON_DEMAND = YES |
11 | PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/restlog | 11 | PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=$GNUNET_TMP/restlog |
12 | 12 | ||
13 | [transport] | 13 | [transport] |
14 | PLUGINS = | 14 | PLUGINS = |
15 | 15 | ||
16 | [identity-provider] | 16 | [identity-provider] |
17 | AUTOSTART = YES | 17 | START_ON_DEMAND = YES |
18 | #PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=$GNUNET_TMP/idplog | 18 | #PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=$GNUNET_TMP/idplog |
19 | 19 | ||
20 | [gns] | 20 | [gns] |
21 | #PREFIX = valgrind --leak-check=full --track-origins=yes | 21 | #PREFIX = valgrind --leak-check=full --track-origins=yes |
22 | AUTOSTART = YES | 22 | START_ON_DEMAND = YES |
23 | AUTO_IMPORT_PKEY = YES | 23 | AUTO_IMPORT_PKEY = YES |
24 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | 24 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 |
25 | DEFAULT_LOOKUP_TIMEOUT = 15 s | 25 | DEFAULT_LOOKUP_TIMEOUT = 15 s |
diff --git a/src/identity/identity.conf.in b/src/identity/identity.conf.in index 4af3a6261..f5d454323 100644 --- a/src/identity/identity.conf.in +++ b/src/identity/identity.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [identity] | 1 | [identity] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | USER_SERVICE = YES | 3 | RUN_PER_USER = YES |
4 | @JAVAPORT@PORT = 2108 | 4 | @JAVAPORT@PORT = 2108 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-identity | 6 | BINARY = gnunet-service-identity |
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index d30b85bfc..b4bf5b0aa 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -24,6 +24,7 @@ | |||
24 | * | 24 | * |
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | * @author Nils Durner | 26 | * @author Nils Durner |
27 | * @author Martin Schanzenbach | ||
27 | * | 28 | * |
28 | * @defgroup logging Logging | 29 | * @defgroup logging Logging |
29 | * @see [Documentation](https://gnunet.org/logging) | 30 | * @see [Documentation](https://gnunet.org/logging) |
@@ -112,6 +113,11 @@ extern "C" | |||
112 | #endif | 113 | #endif |
113 | 114 | ||
114 | /** | 115 | /** |
116 | * wrap va_arg for enums | ||
117 | */ | ||
118 | #define GNUNET_VA_ARG_ENUM(va,X) ((enum X) va_arg (va, int)) | ||
119 | |||
120 | /** | ||
115 | * @ingroup logging | 121 | * @ingroup logging |
116 | * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source | 122 | * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source |
117 | * tree where gnunet_config.h is unavailable | 123 | * tree where gnunet_config.h is unavailable |
@@ -761,14 +767,14 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
761 | * @ingroup logging | 767 | * @ingroup logging |
762 | * Use this for fatal errors that cannot be handled | 768 | * Use this for fatal errors that cannot be handled |
763 | */ | 769 | */ |
764 | #define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0) | 770 | #define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d. Aborting.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0) |
765 | 771 | ||
766 | 772 | ||
767 | /** | 773 | /** |
768 | * @ingroup logging | 774 | * @ingroup logging |
769 | * Use this for fatal errors that cannot be handled | 775 | * Use this for fatal errors that cannot be handled |
770 | */ | 776 | */ |
771 | #define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); GNUNET_abort_(); } } while(0) | 777 | #define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d. Aborting.\n"), f, l); GNUNET_abort_(); } } while(0) |
772 | 778 | ||
773 | 779 | ||
774 | /** | 780 | /** |
@@ -778,7 +784,7 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
778 | * @param cond Condition to evaluate | 784 | * @param cond Condition to evaluate |
779 | * @param comp Component string to use for logging | 785 | * @param comp Component string to use for logging |
780 | */ | 786 | */ |
781 | #define GNUNET_assert_from(cond, comp) do { if (! (cond)) { GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, comp, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0) | 787 | #define GNUNET_assert_from(cond, comp) do { if (! (cond)) { GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, comp, _("Assertion failed at %s:%d. Aborting.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0) |
782 | 788 | ||
783 | 789 | ||
784 | /** | 790 | /** |
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index 13f920937..b6fac6111 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -150,8 +150,9 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | |||
150 | * Cancel pending lookup request | 150 | * Cancel pending lookup request |
151 | * | 151 | * |
152 | * @param lr the lookup request to cancel | 152 | * @param lr the lookup request to cancel |
153 | * @return closure from the lookup result processor | ||
153 | */ | 154 | */ |
154 | void | 155 | void * |
155 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr); | 156 | GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr); |
156 | 157 | ||
157 | 158 | ||
@@ -198,8 +199,9 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle, | |||
198 | * Cancel pending lookup request | 199 | * Cancel pending lookup request |
199 | * | 200 | * |
200 | * @param ltr the lookup request to cancel | 201 | * @param ltr the lookup request to cancel |
202 | * @return closure from the lookup result processor | ||
201 | */ | 203 | */ |
202 | void | 204 | void * |
203 | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr); | 205 | GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr); |
204 | 206 | ||
205 | 207 | ||
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index b3f1eb632..20846238b 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -499,10 +499,10 @@ GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); | |||
499 | 499 | ||
500 | 500 | ||
501 | /** | 501 | /** |
502 | * Convert an absolute domain name in the ".zkey" pTLD to the | 502 | * Convert an absolute domain name to the |
503 | * respective public key. | 503 | * respective public key. |
504 | * | 504 | * |
505 | * @param zkey string "X.zkey" where X is the public | 505 | * @param zkey string "X" where X is the public |
506 | * key in an encoding suitable for DNS labels. | 506 | * key in an encoding suitable for DNS labels. |
507 | * @param pkey set to a public key on the eliptic curve | 507 | * @param pkey set to a public key on the eliptic curve |
508 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax | 508 | * @return #GNUNET_SYSERR if @a zkey has the wrong syntax |
diff --git a/src/integration-tests/confs/c_no_nat_client.conf b/src/integration-tests/confs/c_no_nat_client.conf index 26e816267..38a7d7fbc 100644 --- a/src/integration-tests/confs/c_no_nat_client.conf +++ b/src/integration-tests/confs/c_no_nat_client.conf | |||
@@ -32,13 +32,13 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-arm-18 | |||
32 | PORT = 20022 | 32 | PORT = 20022 |
33 | 33 | ||
34 | [namestore] | 34 | [namestore] |
35 | AUTOSTART = YES | 35 | START_ON_DEMAND = YES |
36 | 36 | ||
37 | [dns] | 37 | [dns] |
38 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-dns-19 | 38 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-dns-19 |
39 | 39 | ||
40 | [consensus] | 40 | [consensus] |
41 | AUTOSTART = YES | 41 | START_ON_DEMAND = YES |
42 | 42 | ||
43 | [core] | 43 | [core] |
44 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-core-17 | 44 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-core-17 |
diff --git a/src/integration-tests/confs/c_no_nat_client_2.conf b/src/integration-tests/confs/c_no_nat_client_2.conf index 0cd6fc4f9..6c8f07632 100644 --- a/src/integration-tests/confs/c_no_nat_client_2.conf +++ b/src/integration-tests/confs/c_no_nat_client_2.conf | |||
@@ -33,16 +33,16 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-arm-18 | |||
33 | PORT = 20022 | 33 | PORT = 20022 |
34 | 34 | ||
35 | [namestore] | 35 | [namestore] |
36 | AUTOSTART = YES | 36 | START_ON_DEMAND = YES |
37 | 37 | ||
38 | [dns] | 38 | [dns] |
39 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-dns-19 | 39 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-dns-19 |
40 | 40 | ||
41 | [consensus] | 41 | [consensus] |
42 | AUTOSTART = YES | 42 | START_ON_DEMAND = YES |
43 | 43 | ||
44 | [lockmanager] | 44 | [lockmanager] |
45 | AUTOSTART = YES | 45 | START_ON_DEMAND = YES |
46 | 46 | ||
47 | [core] | 47 | [core] |
48 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-core-17 | 48 | UNIXPATH = $GNUNET_RUNTIME_DIR/test-service-core-17 |
diff --git a/src/integration-tests/confs/test_defaults.conf b/src/integration-tests/confs/test_defaults.conf index 39020515f..3ccdc2946 100644 --- a/src/integration-tests/confs/test_defaults.conf +++ b/src/integration-tests/confs/test_defaults.conf | |||
@@ -2,25 +2,25 @@ | |||
2 | @INLINE@ ../../../contrib/conf/gnunet/no_autostart_above_core.conf | 2 | @INLINE@ ../../../contrib/conf/gnunet/no_autostart_above_core.conf |
3 | 3 | ||
4 | [fs] | 4 | [fs] |
5 | FORCESTART = YES | 5 | IMMEDIATE_START = YES |
6 | 6 | ||
7 | [datastore] | 7 | [datastore] |
8 | AUTOSTART = YES | 8 | START_ON_DEMAND = YES |
9 | 9 | ||
10 | [dht] | 10 | [dht] |
11 | AUTOSTART = YES | 11 | START_ON_DEMAND = YES |
12 | 12 | ||
13 | [nse] | 13 | [nse] |
14 | AUTOSTART = YES | 14 | START_ON_DEMAND = YES |
15 | 15 | ||
16 | [cadet] | 16 | [cadet] |
17 | AUTOSTART = YES | 17 | START_ON_DEMAND = YES |
18 | 18 | ||
19 | [hostlist] | 19 | [hostlist] |
20 | FORCESTART = YES | 20 | IMMEDIATE_START = YES |
21 | 21 | ||
22 | [topology] | 22 | [topology] |
23 | FORCESTART = YES | 23 | IMMEDIATE_START = YES |
24 | 24 | ||
25 | [peerinfo] | 25 | [peerinfo] |
26 | USE_INCLUDED_HELLOS = NO | 26 | USE_INCLUDED_HELLOS = NO |
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c index cf7dde913..21eb39daa 100644 --- a/src/multicast/gnunet-service-multicast.c +++ b/src/multicast/gnunet-service-multicast.c | |||
@@ -1448,6 +1448,12 @@ check_client_member_join (void *cls, | |||
1448 | uint16_t msg_size = ntohs (msg->header.size); | 1448 | uint16_t msg_size = ntohs (msg->header.size); |
1449 | struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; | 1449 | struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; |
1450 | uint32_t relay_count = ntohl (msg->relay_count); | 1450 | uint32_t relay_count = ntohl (msg->relay_count); |
1451 | |||
1452 | if (0 == relay_count} | ||
1453 | { | ||
1454 | GNUNET_break (0); | ||
1455 | return GNUNET_SYSERR; | ||
1456 | } | ||
1451 | if (UINT32_MAX / relay_count < sizeof (*relays)){ | 1457 | if (UINT32_MAX / relay_count < sizeof (*relays)){ |
1452 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1458 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1453 | "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", | 1459 | "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", |
diff --git a/src/multicast/multicast.conf.in b/src/multicast/multicast.conf.in index f4a6daa1e..97a541336 100644 --- a/src/multicast/multicast.conf.in +++ b/src/multicast/multicast.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [multicast] | 1 | [multicast] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-multicast | 3 | BINARY = gnunet-service-multicast |
4 | 4 | ||
5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock | 5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock |
diff --git a/src/multicast/test_multicast.conf b/src/multicast/test_multicast.conf index 1b50e0893..b2f1a764b 100644 --- a/src/multicast/test_multicast.conf +++ b/src/multicast/test_multicast.conf | |||
@@ -10,7 +10,7 @@ GLOBAL_POSTFIX=-L ERROR | |||
10 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock | 10 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock |
11 | 11 | ||
12 | [vpn] | 12 | [vpn] |
13 | AUTOSTART = NO | 13 | START_ON_DEMAND = NO |
14 | 14 | ||
15 | [peerinfo] | 15 | [peerinfo] |
16 | # Do not use shipped gnunet HELLOs | 16 | # Do not use shipped gnunet HELLOs |
@@ -21,36 +21,36 @@ USE_INCLUDED_HELLOS = NO | |||
21 | NO_IO = YES | 21 | NO_IO = YES |
22 | 22 | ||
23 | [hostlist] | 23 | [hostlist] |
24 | FORCESTART = NO | 24 | IMMEDIATE_START = NO |
25 | AUTOSTART = NO | 25 | START_ON_DEMAND = NO |
26 | 26 | ||
27 | [nat] | 27 | [nat] |
28 | ENABLE_UPNP = NO | 28 | ENABLE_UPNP = NO |
29 | 29 | ||
30 | [fs] | 30 | [fs] |
31 | FORCESTART = NO | 31 | IMMEDIATE_START = NO |
32 | AUTOSTART = NO | 32 | START_ON_DEMAND = NO |
33 | 33 | ||
34 | [vpn] | 34 | [vpn] |
35 | FORCESTART = NO | 35 | IMMEDIATE_START = NO |
36 | AUTOSTART = NO | 36 | START_ON_DEMAND = NO |
37 | 37 | ||
38 | [revocation] | 38 | [revocation] |
39 | FORCESTART = NO | 39 | IMMEDIATE_START = NO |
40 | AUTOSTART = NO | 40 | START_ON_DEMAND = NO |
41 | 41 | ||
42 | [gns] | 42 | [gns] |
43 | FORCESTART = NO | 43 | IMMEDIATE_START = NO |
44 | AUTOSTART = NO | 44 | START_ON_DEMAND = NO |
45 | 45 | ||
46 | [namestore] | 46 | [namestore] |
47 | FORCESTART = NO | 47 | IMMEDIATE_START = NO |
48 | AUTOSTART = NO | 48 | START_ON_DEMAND = NO |
49 | 49 | ||
50 | [namecache] | 50 | [namecache] |
51 | FORCESTART = NO | 51 | IMMEDIATE_START = NO |
52 | AUTOSTART = NO | 52 | START_ON_DEMAND = NO |
53 | 53 | ||
54 | [topology] | 54 | [topology] |
55 | FORCESTART = NO | 55 | IMMEDIATE_START = NO |
56 | AUTOSTART = NO | 56 | START_ON_DEMAND = NO |
diff --git a/src/multicast/test_multicast_line.conf b/src/multicast/test_multicast_line.conf index 1047205cb..c1ce7c63f 100644 --- a/src/multicast/test_multicast_line.conf +++ b/src/multicast/test_multicast_line.conf | |||
@@ -11,7 +11,7 @@ GLOBAL_POSTFIX=-L ERROR | |||
11 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock | 11 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock |
12 | 12 | ||
13 | [vpn] | 13 | [vpn] |
14 | AUTOSTART = NO | 14 | START_ON_DEMAND = NO |
15 | 15 | ||
16 | [peerinfo] | 16 | [peerinfo] |
17 | # Do not use shipped gnunet HELLOs | 17 | # Do not use shipped gnunet HELLOs |
@@ -25,39 +25,39 @@ NO_IO = YES | |||
25 | ID_ANNOUNCE_TIME = 5 s | 25 | ID_ANNOUNCE_TIME = 5 s |
26 | 26 | ||
27 | [hostlist] | 27 | [hostlist] |
28 | FORCESTART = NO | 28 | IMMEDIATE_START = NO |
29 | AUTOSTART = NO | 29 | START_ON_DEMAND = NO |
30 | 30 | ||
31 | [nat] | 31 | [nat] |
32 | ENABLE_UPNP = NO | 32 | ENABLE_UPNP = NO |
33 | 33 | ||
34 | [fs] | 34 | [fs] |
35 | FORCESTART = NO | 35 | IMMEDIATE_START = NO |
36 | AUTOSTART = NO | 36 | START_ON_DEMAND = NO |
37 | 37 | ||
38 | [vpn] | 38 | [vpn] |
39 | FORCESTART = NO | 39 | IMMEDIATE_START = NO |
40 | AUTOSTART = NO | 40 | START_ON_DEMAND = NO |
41 | 41 | ||
42 | [revocation] | 42 | [revocation] |
43 | FORCESTART = NO | 43 | IMMEDIATE_START = NO |
44 | AUTOSTART = NO | 44 | START_ON_DEMAND = NO |
45 | 45 | ||
46 | [gns] | 46 | [gns] |
47 | FORCESTART = NO | 47 | IMMEDIATE_START = NO |
48 | AUTOSTART = NO | 48 | START_ON_DEMAND = NO |
49 | 49 | ||
50 | [namestore] | 50 | [namestore] |
51 | FORCESTART = NO | 51 | IMMEDIATE_START = NO |
52 | AUTOSTART = NO | 52 | START_ON_DEMAND = NO |
53 | 53 | ||
54 | [namecache] | 54 | [namecache] |
55 | FORCESTART = NO | 55 | IMMEDIATE_START = NO |
56 | AUTOSTART = NO | 56 | START_ON_DEMAND = NO |
57 | 57 | ||
58 | [topology] | 58 | [topology] |
59 | FORCESTART = NO | 59 | IMMEDIATE_START = NO |
60 | AUTOSTART = NO | 60 | START_ON_DEMAND = NO |
61 | 61 | ||
62 | [nse] | 62 | [nse] |
63 | WORKBITS = 0 | 63 | WORKBITS = 0 |
diff --git a/src/multicast/test_multicast_star.conf b/src/multicast/test_multicast_star.conf index ed690d95d..516c0e302 100644 --- a/src/multicast/test_multicast_star.conf +++ b/src/multicast/test_multicast_star.conf | |||
@@ -11,7 +11,7 @@ GLOBAL_POSTFIX=-L ERROR | |||
11 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock | 11 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock |
12 | 12 | ||
13 | [vpn] | 13 | [vpn] |
14 | AUTOSTART = NO | 14 | START_ON_DEMAND = NO |
15 | 15 | ||
16 | [peerinfo] | 16 | [peerinfo] |
17 | # Do not use shipped gnunet HELLOs | 17 | # Do not use shipped gnunet HELLOs |
@@ -25,39 +25,39 @@ NO_IO = YES | |||
25 | ID_ANNOUNCE_TIME = 5 s | 25 | ID_ANNOUNCE_TIME = 5 s |
26 | 26 | ||
27 | [hostlist] | 27 | [hostlist] |
28 | FORCESTART = NO | 28 | IMMEDIATE_START = NO |
29 | AUTOSTART = NO | 29 | START_ON_DEMAND = NO |
30 | 30 | ||
31 | [nat] | 31 | [nat] |
32 | ENABLE_UPNP = NO | 32 | ENABLE_UPNP = NO |
33 | 33 | ||
34 | [fs] | 34 | [fs] |
35 | FORCESTART = NO | 35 | IMMEDIATE_START = NO |
36 | AUTOSTART = NO | 36 | START_ON_DEMAND = NO |
37 | 37 | ||
38 | [vpn] | 38 | [vpn] |
39 | FORCESTART = NO | 39 | IMMEDIATE_START = NO |
40 | AUTOSTART = NO | 40 | START_ON_DEMAND = NO |
41 | 41 | ||
42 | [revocation] | 42 | [revocation] |
43 | FORCESTART = NO | 43 | IMMEDIATE_START = NO |
44 | AUTOSTART = NO | 44 | START_ON_DEMAND = NO |
45 | 45 | ||
46 | [gns] | 46 | [gns] |
47 | FORCESTART = NO | 47 | IMMEDIATE_START = NO |
48 | AUTOSTART = NO | 48 | START_ON_DEMAND = NO |
49 | 49 | ||
50 | [namestore] | 50 | [namestore] |
51 | FORCESTART = NO | 51 | IMMEDIATE_START = NO |
52 | AUTOSTART = NO | 52 | START_ON_DEMAND = NO |
53 | 53 | ||
54 | [namecache] | 54 | [namecache] |
55 | FORCESTART = NO | 55 | IMMEDIATE_START = NO |
56 | AUTOSTART = NO | 56 | START_ON_DEMAND = NO |
57 | 57 | ||
58 | [topology] | 58 | [topology] |
59 | FORCESTART = NO | 59 | IMMEDIATE_START = NO |
60 | AUTOSTART = NO | 60 | START_ON_DEMAND = NO |
61 | 61 | ||
62 | [nse] | 62 | [nse] |
63 | WORKBITS = 0 | 63 | WORKBITS = 0 |
diff --git a/src/namecache/gnunet-service-namecache.c b/src/namecache/gnunet-service-namecache.c index cda1267e8..c852aaacc 100644 --- a/src/namecache/gnunet-service-namecache.c +++ b/src/namecache/gnunet-service-namecache.c | |||
@@ -148,7 +148,11 @@ struct LookupBlockContext | |||
148 | * Operation id for the name lookup | 148 | * Operation id for the name lookup |
149 | */ | 149 | */ |
150 | uint32_t request_id; | 150 | uint32_t request_id; |
151 | 151 | ||
152 | /** | ||
153 | * Lookup status | ||
154 | */ | ||
155 | int status; | ||
152 | }; | 156 | }; |
153 | 157 | ||
154 | 158 | ||
@@ -166,7 +170,17 @@ handle_lookup_block_it (void *cls, | |||
166 | struct GNUNET_MQ_Envelope *env; | 170 | struct GNUNET_MQ_Envelope *env; |
167 | struct LookupBlockResponseMessage *r; | 171 | struct LookupBlockResponseMessage *r; |
168 | size_t esize; | 172 | size_t esize; |
173 | size_t bsize; | ||
169 | 174 | ||
175 | bsize = ntohl (block->purpose.size); | ||
176 | if (bsize < | ||
177 | (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO))) | ||
178 | { | ||
179 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
180 | "Malformed block."); | ||
181 | lnc->status = GNUNET_SYSERR; | ||
182 | return; | ||
183 | } | ||
170 | esize = ntohl (block->purpose.size) | 184 | esize = ntohl (block->purpose.size) |
171 | - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) | 185 | - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) |
172 | - sizeof (struct GNUNET_TIME_AbsoluteNBO); | 186 | - sizeof (struct GNUNET_TIME_AbsoluteNBO); |
@@ -209,6 +223,7 @@ handle_lookup_block (void *cls, | |||
209 | 223 | ||
210 | lnc.request_id = ntohl (ln_msg->gns_header.r_id); | 224 | lnc.request_id = ntohl (ln_msg->gns_header.r_id); |
211 | lnc.nc = nc; | 225 | lnc.nc = nc; |
226 | lnc.status = GNUNET_OK; | ||
212 | if (GNUNET_SYSERR == | 227 | if (GNUNET_SYSERR == |
213 | (ret = GSN_database->lookup_block (GSN_database->cls, | 228 | (ret = GSN_database->lookup_block (GSN_database->cls, |
214 | &ln_msg->query, | 229 | &ln_msg->query, |
@@ -222,7 +237,7 @@ handle_lookup_block (void *cls, | |||
222 | GNUNET_SERVICE_client_drop (nc->client); | 237 | GNUNET_SERVICE_client_drop (nc->client); |
223 | return; | 238 | return; |
224 | } | 239 | } |
225 | if (0 == ret) | 240 | if ((0 == ret) || (GNUNET_SYSERR == lnc.status)) |
226 | { | 241 | { |
227 | /* no records match at all, generate empty response */ | 242 | /* no records match at all, generate empty response */ |
228 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 243 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/namecache/namecache.conf.in b/src/namecache/namecache.conf.in index becd34187..cf1340846 100644 --- a/src/namecache/namecache.conf.in +++ b/src/namecache/namecache.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [namecache] | 1 | [namecache] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | USER_SERVICE = NO | 3 | RUN_PER_USER = NO |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-namecache.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-namecache.sock |
5 | UNIX_MATCH_UID = NO | 5 | UNIX_MATCH_UID = NO |
6 | UNIX_MATCH_GID = YES | 6 | UNIX_MATCH_GID = YES |
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c index 2bb233da1..2a60a2813 100644 --- a/src/namecache/namecache_api.c +++ b/src/namecache/namecache_api.c | |||
@@ -483,9 +483,11 @@ GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h, | |||
483 | 483 | ||
484 | if (NULL == h->mq) | 484 | if (NULL == h->mq) |
485 | return NULL; | 485 | return NULL; |
486 | blen = ntohl (block->purpose.size) | 486 | blen = ntohl (block->purpose.size); |
487 | - sizeof (struct GNUNET_TIME_AbsoluteNBO) | 487 | GNUNET_assert (blen > (sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
488 | - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose); | 488 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose))); |
489 | blen -= (sizeof (struct GNUNET_TIME_AbsoluteNBO) + | ||
490 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); | ||
489 | rid = get_op_id (h); | 491 | rid = get_op_id (h); |
490 | qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry); | 492 | qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry); |
491 | qe->nsh = h; | 493 | qe->nsh = h; |
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index f4cdf26b4..0853ff4d7 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c | |||
@@ -117,7 +117,11 @@ struct Request | |||
117 | * a POST request). | 117 | * a POST request). |
118 | */ | 118 | */ |
119 | struct MHD_PostProcessor *pp; | 119 | struct MHD_PostProcessor *pp; |
120 | 120 | ||
121 | /** | ||
122 | * MHD Connection | ||
123 | */ | ||
124 | struct MHD_Connection *con; | ||
121 | /** | 125 | /** |
122 | * URL to serve in response to this POST (if this request | 126 | * URL to serve in response to this POST (if this request |
123 | * was a 'POST') | 127 | * was a 'POST') |
@@ -130,6 +134,11 @@ struct Request | |||
130 | struct GNUNET_NAMESTORE_QueueEntry *qe; | 134 | struct GNUNET_NAMESTORE_QueueEntry *qe; |
131 | 135 | ||
132 | /** | 136 | /** |
137 | * Active lookup iterator | ||
138 | * TODO: deprecate or fix lookup by label and use above member | ||
139 | */ | ||
140 | struct GNUNET_NAMESTORE_ZoneIterator *lookup_it; | ||
141 | /** | ||
133 | * Active iteration with the namestore. | 142 | * Active iteration with the namestore. |
134 | */ | 143 | */ |
135 | struct GNUNET_NAMESTORE_ZoneIterator *zi; | 144 | struct GNUNET_NAMESTORE_ZoneIterator *zi; |
@@ -569,6 +578,7 @@ put_continuation (void *cls, | |||
569 | } | 578 | } |
570 | else | 579 | else |
571 | request->phase = RP_SUCCESS; | 580 | request->phase = RP_SUCCESS; |
581 | MHD_resume_connection (request->con); | ||
572 | run_httpd_now (); | 582 | run_httpd_now (); |
573 | } | 583 | } |
574 | 584 | ||
@@ -584,6 +594,7 @@ zone_to_name_error (void *cls) | |||
584 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 594 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
585 | _("Error when mapping zone to name\n")); | 595 | _("Error when mapping zone to name\n")); |
586 | request->phase = RP_FAIL; | 596 | request->phase = RP_FAIL; |
597 | MHD_resume_connection (request->con); | ||
587 | run_httpd_now (); | 598 | run_httpd_now (); |
588 | } | 599 | } |
589 | 600 | ||
@@ -616,6 +627,7 @@ zone_to_name_cb (void *cls, | |||
616 | _("Found existing name `%s' for the given key\n"), | 627 | _("Found existing name `%s' for the given key\n"), |
617 | name); | 628 | name); |
618 | request->phase = RP_FAIL; | 629 | request->phase = RP_FAIL; |
630 | MHD_resume_connection (request->con); | ||
619 | run_httpd_now (); | 631 | run_httpd_now (); |
620 | return; | 632 | return; |
621 | } | 633 | } |
@@ -637,10 +649,10 @@ zone_to_name_cb (void *cls, | |||
637 | * We encountered an error in the name lookup. | 649 | * We encountered an error in the name lookup. |
638 | */ | 650 | */ |
639 | static void | 651 | static void |
640 | lookup_block_error (void *cls) | 652 | lookup_it_error (void *cls) |
641 | { | 653 | { |
642 | struct Request *request = cls; | 654 | struct Request *request = cls; |
643 | 655 | MHD_resume_connection (request->con); | |
644 | request->qe = NULL; | 656 | request->qe = NULL; |
645 | request->phase = RP_FAIL; | 657 | request->phase = RP_FAIL; |
646 | run_httpd_now (); | 658 | run_httpd_now (); |
@@ -658,7 +670,7 @@ lookup_block_error (void *cls) | |||
658 | * @param rd array of records with data to store | 670 | * @param rd array of records with data to store |
659 | */ | 671 | */ |
660 | static void | 672 | static void |
661 | lookup_block_processor (void *cls, | 673 | lookup_it_processor (void *cls, |
662 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zonekey, | 674 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zonekey, |
663 | const char *label, | 675 | const char *label, |
664 | unsigned int rd_count, | 676 | unsigned int rd_count, |
@@ -669,39 +681,48 @@ lookup_block_processor (void *cls, | |||
669 | (void) label; | 681 | (void) label; |
670 | (void) rd; | 682 | (void) rd; |
671 | (void) zonekey; | 683 | (void) zonekey; |
672 | request->qe = NULL; | 684 | if (0 == strcmp (label, request->domain_name)) { |
673 | if (0 == rd_count) | 685 | GNUNET_break (0 != rd_count); |
686 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
687 | _("Found %u existing records for domain `%s'\n"), | ||
688 | rd_count, | ||
689 | request->domain_name); | ||
690 | request->phase = RP_FAIL; | ||
691 | } | ||
692 | GNUNET_NAMESTORE_zone_iterator_next (request->lookup_it, 1); | ||
693 | } | ||
694 | |||
695 | static void | ||
696 | lookup_it_finished (void *cls) | ||
697 | { | ||
698 | struct Request *request = cls; | ||
699 | |||
700 | if (RP_FAIL == request->phase) | ||
674 | { | 701 | { |
675 | if (GNUNET_OK != | 702 | MHD_resume_connection (request->con); |
676 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, | 703 | run_httpd_now (); |
677 | strlen (request->public_key), | ||
678 | &request->pub)) | ||
679 | { | ||
680 | GNUNET_break (0); | ||
681 | request->phase = RP_FAIL; | ||
682 | run_httpd_now (); | ||
683 | return; | ||
684 | } | ||
685 | request->qe = GNUNET_NAMESTORE_zone_to_name (ns, | ||
686 | &fcfs_zone_pkey, | ||
687 | &request->pub, | ||
688 | &zone_to_name_error, | ||
689 | request, | ||
690 | &zone_to_name_cb, | ||
691 | request); | ||
692 | return; | 704 | return; |
693 | } | 705 | } |
694 | GNUNET_break (0 != rd_count); | 706 | if (GNUNET_OK != |
695 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 707 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, |
696 | _("Found %u existing records for domain `%s'\n"), | 708 | strlen (request->public_key), |
697 | rd_count, | 709 | &request->pub)) |
698 | request->domain_name); | 710 | { |
699 | request->phase = RP_FAIL; | 711 | GNUNET_break (0); |
700 | run_httpd_now (); | 712 | request->phase = RP_FAIL; |
701 | return; | 713 | MHD_resume_connection (request->con); |
714 | run_httpd_now (); | ||
715 | return; | ||
716 | } | ||
717 | request->qe = GNUNET_NAMESTORE_zone_to_name (ns, | ||
718 | &fcfs_zone_pkey, | ||
719 | &request->pub, | ||
720 | &zone_to_name_error, | ||
721 | request, | ||
722 | &zone_to_name_cb, | ||
723 | request); | ||
702 | } | 724 | } |
703 | 725 | ||
704 | |||
705 | /** | 726 | /** |
706 | * Main MHD callback for handling requests. | 727 | * Main MHD callback for handling requests. |
707 | * | 728 | * |
@@ -727,13 +748,13 @@ lookup_block_processor (void *cls, | |||
727 | */ | 748 | */ |
728 | static int | 749 | static int |
729 | create_response (void *cls, | 750 | create_response (void *cls, |
730 | struct MHD_Connection *connection, | 751 | struct MHD_Connection *connection, |
731 | const char *url, | 752 | const char *url, |
732 | const char *method, | 753 | const char *method, |
733 | const char *version, | 754 | const char *version, |
734 | const char *upload_data, | 755 | const char *upload_data, |
735 | size_t *upload_data_size, | 756 | size_t *upload_data_size, |
736 | void **ptr) | 757 | void **ptr) |
737 | { | 758 | { |
738 | struct MHD_Response *response; | 759 | struct MHD_Response *response; |
739 | struct Request *request; | 760 | struct Request *request; |
@@ -744,114 +765,117 @@ create_response (void *cls, | |||
744 | (void) version; | 765 | (void) version; |
745 | if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) || | 766 | if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) || |
746 | (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) ) | 767 | (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) ) |
747 | { | 768 | { |
748 | if (0 == strcmp (url, FCFS_ZONEINFO_URL)) | 769 | if (0 == strcmp (url, FCFS_ZONEINFO_URL)) |
749 | ret = serve_zoneinfo_page (connection); | 770 | ret = serve_zoneinfo_page (connection); |
750 | else | 771 | else |
751 | ret = serve_main_page (connection); | 772 | ret = serve_main_page (connection); |
752 | if (ret != MHD_YES) | 773 | if (ret != MHD_YES) |
753 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 774 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
754 | _("Failed to create page for `%s'\n"), | 775 | _("Failed to create page for `%s'\n"), |
755 | url); | 776 | url); |
756 | return ret; | 777 | return ret; |
757 | } | 778 | } |
758 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) | 779 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) |
780 | { | ||
781 | request = *ptr; | ||
782 | if (NULL == request) | ||
759 | { | 783 | { |
760 | request = *ptr; | 784 | request = GNUNET_new (struct Request); |
761 | if (NULL == request) | 785 | request->con = connection; |
762 | { | 786 | *ptr = request; |
763 | request = GNUNET_new (struct Request); | 787 | request->pp = MHD_create_post_processor (connection, |
764 | *ptr = request; | 788 | 1024, |
765 | request->pp = MHD_create_post_processor (connection, | 789 | &post_iterator, |
766 | 1024, | 790 | request); |
767 | &post_iterator, | 791 | if (NULL == request->pp) |
768 | request); | ||
769 | if (NULL == request->pp) | ||
770 | { | ||
771 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
772 | _("Failed to setup post processor for `%s'\n"), | ||
773 | url); | ||
774 | return MHD_NO; /* internal error */ | ||
775 | } | ||
776 | return MHD_YES; | ||
777 | } | ||
778 | if (NULL != request->pp) | ||
779 | { | 792 | { |
780 | /* evaluate POST data */ | 793 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
781 | MHD_post_process (request->pp, | 794 | _("Failed to setup post processor for `%s'\n"), |
782 | upload_data, | 795 | url); |
783 | *upload_data_size); | 796 | return MHD_NO; /* internal error */ |
784 | if (0 != *upload_data_size) | ||
785 | { | ||
786 | *upload_data_size = 0; | ||
787 | return MHD_YES; | ||
788 | } | ||
789 | /* done with POST data, serve response */ | ||
790 | MHD_destroy_post_processor (request->pp); | ||
791 | request->pp = NULL; | ||
792 | } | 797 | } |
793 | if (GNUNET_OK != | 798 | return MHD_YES; |
794 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, | 799 | } |
795 | strlen (request->public_key), | 800 | if (NULL != request->pp) |
796 | &pub)) | 801 | { |
802 | /* evaluate POST data */ | ||
803 | MHD_post_process (request->pp, | ||
804 | upload_data, | ||
805 | *upload_data_size); | ||
806 | if (0 != *upload_data_size) | ||
797 | { | 807 | { |
798 | /* parse error */ | 808 | *upload_data_size = 0; |
799 | return fill_s_reply ("Failed to parse given public key", | 809 | return MHD_YES; |
800 | request, connection); | ||
801 | } | 810 | } |
802 | switch (request->phase) | 811 | /* done with POST data, serve response */ |
803 | { | 812 | MHD_destroy_post_processor (request->pp); |
804 | case RP_START: | 813 | request->pp = NULL; |
805 | if (NULL != strchr (request->domain_name, (int) '.')) | 814 | } |
806 | { | 815 | if (GNUNET_OK != |
807 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 816 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, |
808 | _("Domain name must not contain `.'\n")); | 817 | strlen (request->public_key), |
809 | request->phase = RP_FAIL; | 818 | &pub)) |
810 | return fill_s_reply ("Domain name must not contain `.', sorry.", | 819 | { |
811 | request, | 820 | /* parse error */ |
812 | connection); | 821 | return fill_s_reply ("Failed to parse given public key", |
813 | } | 822 | request, connection); |
814 | if (NULL != strchr (request->domain_name, (int) '+')) | 823 | } |
815 | { | 824 | switch (request->phase) |
816 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 825 | { |
817 | _("Domain name must not contain `+'\n")); | 826 | case RP_START: |
818 | request->phase = RP_FAIL; | 827 | if (NULL != strchr (request->domain_name, (int) '.')) |
819 | return fill_s_reply ("Domain name must not contain `+', sorry.", | 828 | { |
820 | request, connection); | 829 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
821 | } | 830 | _("Domain name must not contain `.'\n")); |
822 | request->phase = RP_LOOKUP; | 831 | request->phase = RP_FAIL; |
823 | request->qe | 832 | return fill_s_reply ("Domain name must not contain `.', sorry.", |
824 | = GNUNET_NAMESTORE_records_lookup (ns, | 833 | request, |
825 | &fcfs_zone_pkey, | 834 | connection); |
826 | request->domain_name, | 835 | } |
827 | &lookup_block_error, | 836 | if (NULL != strchr (request->domain_name, (int) '+')) |
828 | request, | 837 | { |
829 | &lookup_block_processor, | 838 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
830 | request); | 839 | _("Domain name must not contain `+'\n")); |
831 | break; | 840 | request->phase = RP_FAIL; |
832 | case RP_LOOKUP: | 841 | return fill_s_reply ("Domain name must not contain `+', sorry.", |
833 | break; | 842 | request, connection); |
834 | case RP_PUT: | 843 | } |
835 | break; | 844 | request->phase = RP_LOOKUP; |
836 | case RP_FAIL: | 845 | MHD_suspend_connection (request->con); |
837 | return fill_s_reply ("Request failed, sorry.", | 846 | request->lookup_it |
838 | request, connection); | 847 | = GNUNET_NAMESTORE_zone_iteration_start (ns, |
839 | case RP_SUCCESS: | 848 | &fcfs_zone_pkey, |
840 | return fill_s_reply ("Success.", | 849 | &lookup_it_error, |
841 | request, connection); | 850 | request, |
842 | default: | 851 | &lookup_it_processor, |
843 | GNUNET_break (0); | 852 | request, |
844 | return MHD_NO; | 853 | &lookup_it_finished, |
845 | } | 854 | request); |
846 | return MHD_YES; /* will have a reply later... */ | 855 | break; |
856 | case RP_LOOKUP: | ||
857 | break; | ||
858 | case RP_PUT: | ||
859 | break; | ||
860 | case RP_FAIL: | ||
861 | return fill_s_reply ("Request failed, sorry.", | ||
862 | request, connection); | ||
863 | case RP_SUCCESS: | ||
864 | return fill_s_reply ("Success.", | ||
865 | request, connection); | ||
866 | default: | ||
867 | GNUNET_break (0); | ||
868 | return MHD_NO; | ||
847 | } | 869 | } |
870 | return MHD_YES; /* will have a reply later... */ | ||
871 | } | ||
848 | /* unsupported HTTP method */ | 872 | /* unsupported HTTP method */ |
849 | response = MHD_create_response_from_buffer (strlen (METHOD_ERROR), | 873 | response = MHD_create_response_from_buffer (strlen (METHOD_ERROR), |
850 | (void *) METHOD_ERROR, | 874 | (void *) METHOD_ERROR, |
851 | MHD_RESPMEM_PERSISTENT); | 875 | MHD_RESPMEM_PERSISTENT); |
852 | ret = MHD_queue_response (connection, | 876 | ret = MHD_queue_response (connection, |
853 | MHD_HTTP_NOT_ACCEPTABLE, | 877 | MHD_HTTP_NOT_ACCEPTABLE, |
854 | response); | 878 | response); |
855 | MHD_destroy_response (response); | 879 | MHD_destroy_response (response); |
856 | return ret; | 880 | return ret; |
857 | } | 881 | } |
@@ -868,9 +892,9 @@ create_response (void *cls, | |||
868 | */ | 892 | */ |
869 | static void | 893 | static void |
870 | request_completed_callback (void *cls, | 894 | request_completed_callback (void *cls, |
871 | struct MHD_Connection *connection, | 895 | struct MHD_Connection *connection, |
872 | void **con_cls, | 896 | void **con_cls, |
873 | enum MHD_RequestTerminationCode toe) | 897 | enum MHD_RequestTerminationCode toe) |
874 | { | 898 | { |
875 | struct Request *request = *con_cls; | 899 | struct Request *request = *con_cls; |
876 | 900 | ||
@@ -915,33 +939,33 @@ run_httpd () | |||
915 | wws = GNUNET_NETWORK_fdset_create (); | 939 | wws = GNUNET_NETWORK_fdset_create (); |
916 | max = -1; | 940 | max = -1; |
917 | GNUNET_assert (MHD_YES == | 941 | GNUNET_assert (MHD_YES == |
918 | MHD_get_fdset (httpd, | 942 | MHD_get_fdset (httpd, |
919 | &rs, | 943 | &rs, |
920 | &ws, | 944 | &ws, |
921 | &es, | 945 | &es, |
922 | &max)); | 946 | &max)); |
923 | haveto = MHD_get_timeout (httpd, | 947 | haveto = MHD_get_timeout (httpd, |
924 | &timeout); | 948 | &timeout); |
925 | if (haveto == MHD_YES) | 949 | if (haveto == MHD_YES) |
926 | tv.rel_value_us = (uint64_t) timeout * 1000LL; | 950 | tv.rel_value_us = (uint64_t) timeout * 1000LL; |
927 | else | 951 | else |
928 | tv = GNUNET_TIME_UNIT_FOREVER_REL; | 952 | tv = GNUNET_TIME_UNIT_FOREVER_REL; |
929 | GNUNET_NETWORK_fdset_copy_native (wrs, | 953 | GNUNET_NETWORK_fdset_copy_native (wrs, |
930 | &rs, | 954 | &rs, |
931 | max + 1); | 955 | max + 1); |
932 | GNUNET_NETWORK_fdset_copy_native (wws, | 956 | GNUNET_NETWORK_fdset_copy_native (wws, |
933 | &ws, | 957 | &ws, |
934 | max + 1); | 958 | max + 1); |
935 | GNUNET_NETWORK_fdset_copy_native (wes, | 959 | GNUNET_NETWORK_fdset_copy_native (wes, |
936 | &es, | 960 | &es, |
937 | max + 1); | 961 | max + 1); |
938 | httpd_task = | 962 | httpd_task = |
939 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH, | 963 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH, |
940 | tv, | 964 | tv, |
941 | wrs, | 965 | wrs, |
942 | wws, | 966 | wws, |
943 | &do_httpd, | 967 | &do_httpd, |
944 | NULL); | 968 | NULL); |
945 | GNUNET_NETWORK_fdset_destroy (wrs); | 969 | GNUNET_NETWORK_fdset_destroy (wrs); |
946 | GNUNET_NETWORK_fdset_destroy (wws); | 970 | GNUNET_NETWORK_fdset_destroy (wws); |
947 | GNUNET_NETWORK_fdset_destroy (wes); | 971 | GNUNET_NETWORK_fdset_destroy (wes); |
@@ -1026,9 +1050,9 @@ do_shutdown (void *cls) | |||
1026 | */ | 1050 | */ |
1027 | static void | 1051 | static void |
1028 | identity_cb (void *cls, | 1052 | identity_cb (void *cls, |
1029 | struct GNUNET_IDENTITY_Ego *ego, | 1053 | struct GNUNET_IDENTITY_Ego *ego, |
1030 | void **ctx, | 1054 | void **ctx, |
1031 | const char *name) | 1055 | const char *name) |
1032 | { | 1056 | { |
1033 | int options; | 1057 | int options; |
1034 | 1058 | ||
@@ -1037,40 +1061,40 @@ identity_cb (void *cls, | |||
1037 | if (NULL == name) | 1061 | if (NULL == name) |
1038 | return; | 1062 | return; |
1039 | if (0 != strcmp (name, | 1063 | if (0 != strcmp (name, |
1040 | zone)) | 1064 | zone)) |
1041 | return; | 1065 | return; |
1042 | if (NULL == ego) | 1066 | if (NULL == ego) |
1043 | { | 1067 | { |
1044 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1068 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1045 | _("No ego configured for `fcfsd` subsystem\n")); | 1069 | _("No ego configured for `fcfsd` subsystem\n")); |
1046 | GNUNET_SCHEDULER_shutdown (); | 1070 | GNUNET_SCHEDULER_shutdown (); |
1047 | return; | 1071 | return; |
1048 | } | 1072 | } |
1049 | fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); | 1073 | fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); |
1050 | 1074 | ||
1051 | options = MHD_USE_DUAL_STACK | MHD_USE_DEBUG; | 1075 | options = MHD_USE_DUAL_STACK | MHD_USE_DEBUG | MHD_ALLOW_SUSPEND_RESUME; |
1052 | do | 1076 | do |
1053 | { | 1077 | { |
1054 | httpd = MHD_start_daemon (options, | 1078 | httpd = MHD_start_daemon (options, |
1055 | (uint16_t) port, | 1079 | (uint16_t) port, |
1056 | NULL, NULL, | 1080 | NULL, NULL, |
1057 | &create_response, NULL, | 1081 | &create_response, NULL, |
1058 | MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128, | 1082 | MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128, |
1059 | MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1, | 1083 | MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1, |
1060 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, | 1084 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, |
1061 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024), | 1085 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024), |
1062 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL, | 1086 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL, |
1063 | MHD_OPTION_END); | 1087 | MHD_OPTION_END); |
1064 | if (MHD_USE_DEBUG == options) | 1088 | if (MHD_USE_DEBUG == options) |
1065 | break; | 1089 | break; |
1066 | options = MHD_USE_DEBUG; | 1090 | options = MHD_USE_DEBUG; |
1067 | } | 1091 | } |
1068 | while (NULL == httpd); | 1092 | while (NULL == httpd); |
1069 | if (NULL == httpd) | 1093 | if (NULL == httpd) |
1070 | { | 1094 | { |
1071 | 1095 | ||
1072 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1096 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1073 | _("Failed to start HTTP server\n")); | 1097 | _("Failed to start HTTP server\n")); |
1074 | GNUNET_SCHEDULER_shutdown (); | 1098 | GNUNET_SCHEDULER_shutdown (); |
1075 | return; | 1099 | return; |
1076 | } | 1100 | } |
@@ -1097,24 +1121,24 @@ run (void *cls, | |||
1097 | (void) cfgfile; | 1121 | (void) cfgfile; |
1098 | if (GNUNET_OK != | 1122 | if (GNUNET_OK != |
1099 | GNUNET_CONFIGURATION_get_value_number (cfg, | 1123 | GNUNET_CONFIGURATION_get_value_number (cfg, |
1100 | "fcfsd", | 1124 | "fcfsd", |
1101 | "HTTPPORT", | 1125 | "HTTPPORT", |
1102 | &port)) | 1126 | &port)) |
1103 | { | 1127 | { |
1104 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | 1128 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
1105 | "fcfsd", "HTTPPORT"); | 1129 | "fcfsd", "HTTPPORT"); |
1106 | return; | 1130 | return; |
1107 | } | 1131 | } |
1108 | ns = GNUNET_NAMESTORE_connect (cfg); | 1132 | ns = GNUNET_NAMESTORE_connect (cfg); |
1109 | if (NULL == ns) | 1133 | if (NULL == ns) |
1110 | { | 1134 | { |
1111 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1135 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1112 | _("Failed to connect to namestore\n")); | 1136 | _("Failed to connect to namestore\n")); |
1113 | return; | 1137 | return; |
1114 | } | 1138 | } |
1115 | identity = GNUNET_IDENTITY_connect (cfg, | 1139 | identity = GNUNET_IDENTITY_connect (cfg, |
1116 | &identity_cb, | 1140 | &identity_cb, |
1117 | NULL); | 1141 | NULL); |
1118 | if (NULL == identity) | 1142 | if (NULL == identity) |
1119 | { | 1143 | { |
1120 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1144 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1122,9 +1146,9 @@ run (void *cls, | |||
1122 | return; | 1146 | return; |
1123 | } | 1147 | } |
1124 | uzp_task = GNUNET_SCHEDULER_add_now (&update_zoneinfo_page, | 1148 | uzp_task = GNUNET_SCHEDULER_add_now (&update_zoneinfo_page, |
1125 | NULL); | 1149 | NULL); |
1126 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, | 1150 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, |
1127 | NULL); | 1151 | NULL); |
1128 | } | 1152 | } |
1129 | 1153 | ||
1130 | 1154 | ||
@@ -1141,31 +1165,31 @@ main (int argc, | |||
1141 | { | 1165 | { |
1142 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 1166 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
1143 | GNUNET_GETOPT_option_mandatory | 1167 | GNUNET_GETOPT_option_mandatory |
1144 | (GNUNET_GETOPT_option_string ('z', | 1168 | (GNUNET_GETOPT_option_string ('z', |
1145 | "zone", | 1169 | "zone", |
1146 | "EGO", | 1170 | "EGO", |
1147 | gettext_noop ("name of the zone that is to be managed by FCFSD"), | 1171 | gettext_noop ("name of the zone that is to be managed by FCFSD"), |
1148 | &zone)), | 1172 | &zone)), |
1149 | GNUNET_GETOPT_OPTION_END | 1173 | GNUNET_GETOPT_OPTION_END |
1150 | }; | 1174 | }; |
1151 | int ret; | 1175 | int ret; |
1152 | 1176 | ||
1153 | if (GNUNET_OK != | 1177 | if (GNUNET_OK != |
1154 | GNUNET_STRINGS_get_utf8_args (argc, argv, | 1178 | GNUNET_STRINGS_get_utf8_args (argc, argv, |
1155 | &argc, &argv)) | 1179 | &argc, &argv)) |
1156 | return 2; | 1180 | return 2; |
1157 | 1181 | ||
1158 | GNUNET_log_setup ("fcfsd", | 1182 | GNUNET_log_setup ("fcfsd", |
1159 | "WARNING", | 1183 | "WARNING", |
1160 | NULL); | 1184 | NULL); |
1161 | ret = | 1185 | ret = |
1162 | (GNUNET_OK == | 1186 | (GNUNET_OK == |
1163 | GNUNET_PROGRAM_run (argc, | 1187 | GNUNET_PROGRAM_run (argc, |
1164 | argv, | 1188 | argv, |
1165 | "gnunet-namestore-fcfsd", | 1189 | "gnunet-namestore-fcfsd", |
1166 | _("GNU Name System First Come First Serve name registration service"), | 1190 | _("GNU Name System First Come First Serve name registration service"), |
1167 | options, | 1191 | options, |
1168 | &run, NULL)) ? 0 : 1; | 1192 | &run, NULL)) ? 0 : 1; |
1169 | GNUNET_free ((void*) argv); | 1193 | GNUNET_free ((void*) argv); |
1170 | GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey); | 1194 | GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey); |
1171 | return ret; | 1195 | return ret; |
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 6ffd99773..c5f48848e 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -752,12 +752,13 @@ handle_reverse_lookup (void *cls, | |||
752 | reverse_qe = NULL; | 752 | reverse_qe = NULL; |
753 | if (NULL == label) | 753 | if (NULL == label) |
754 | FPRINTF (stdout, | 754 | FPRINTF (stdout, |
755 | "%s.zkey\n", | 755 | "%s\n", |
756 | reverse_pkey); | 756 | reverse_pkey); |
757 | else | 757 | else |
758 | FPRINTF (stdout, | 758 | FPRINTF (stdout, |
759 | "%s.gnu\n", | 759 | "%s.%s\n", |
760 | label); | 760 | label, |
761 | ego_name); | ||
761 | test_finished (); | 762 | test_finished (); |
762 | } | 763 | } |
763 | 764 | ||
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in index 8b5e440b8..eb95f95be 100644 --- a/src/namestore/namestore.conf.in +++ b/src/namestore/namestore.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [namestore] | 1 | [namestore] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | USER_SERVICE = YES | 3 | RUN_PER_USER = YES |
4 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-namestore.sock | 4 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-namestore.sock |
5 | UNIX_MATCH_UID = NO | 5 | UNIX_MATCH_UID = NO |
6 | UNIX_MATCH_GID = YES | 6 | UNIX_MATCH_GID = YES |
@@ -42,7 +42,7 @@ gns = gnunet-namestore | |||
42 | [fcfsd] | 42 | [fcfsd] |
43 | # Name of the fcfs registration service binary (for ARM) | 43 | # Name of the fcfs registration service binary (for ARM) |
44 | BINARY = gnunet-namestore-fcfsd | 44 | BINARY = gnunet-namestore-fcfsd |
45 | AUTOSTART = NO | 45 | START_ON_DEMAND = NO |
46 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fcfsd.sock | 46 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fcfsd.sock |
47 | 47 | ||
48 | # On what port does the FCFS daemon listen for HTTP clients? | 48 | # On what port does the FCFS daemon listen for HTTP clients? |
diff --git a/src/namestore/test_namestore_api.conf b/src/namestore/test_namestore_api.conf index 5e96eab7c..3e75c2ded 100644 --- a/src/namestore/test_namestore_api.conf +++ b/src/namestore/test_namestore_api.conf | |||
@@ -6,14 +6,14 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-namestore/ | |||
6 | 6 | ||
7 | [namestore] | 7 | [namestore] |
8 | DATABASE = sqlite | 8 | DATABASE = sqlite |
9 | AUTOSTART = YES | 9 | START_ON_DEMAND = YES |
10 | 10 | ||
11 | [namecache] | 11 | [namecache] |
12 | DATABASE = sqlite | 12 | DATABASE = sqlite |
13 | AUTOSTART = YES | 13 | START_ON_DEMAND = YES |
14 | 14 | ||
15 | [identity] | 15 | [identity] |
16 | AUTOSTART = YES | 16 | START_ON_DEMAND = YES |
17 | 17 | ||
18 | [nse] | 18 | [nse] |
19 | WORKBITS = 0 | 19 | WORKBITS = 0 |
diff --git a/src/nat-auto/nat-auto.conf.in b/src/nat-auto/nat-auto.conf.in index 9461ffcc8..d5f5c4eef 100644 --- a/src/nat-auto/nat-auto.conf.in +++ b/src/nat-auto/nat-auto.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [nat-auto] | 1 | [nat-auto] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@ PORT = 2124 | 3 | @UNIXONLY@ PORT = 2124 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-nat-auto | 5 | BINARY = gnunet-service-nat-auto |
diff --git a/src/nat/nat.conf.in b/src/nat/nat.conf.in index 87fe29d9c..a8dbee953 100644 --- a/src/nat/nat.conf.in +++ b/src/nat/nat.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [nat] | 1 | [nat] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@ PORT = 2121 | 3 | @UNIXONLY@ PORT = 2121 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-nat | 5 | BINARY = gnunet-service-nat |
diff --git a/src/nat/test_nat_test_data.conf b/src/nat/test_nat_test_data.conf index c0174bf53..84de6159e 100644 --- a/src/nat/test_nat_test_data.conf +++ b/src/nat/test_nat_test_data.conf | |||
@@ -42,6 +42,6 @@ DISABLEV6 = YES | |||
42 | 42 | ||
43 | 43 | ||
44 | [nse] | 44 | [nse] |
45 | AUTOSTART = NO | 45 | START_ON_DEMAND = NO |
46 | 46 | ||
47 | 47 | ||
diff --git a/src/nse/nse.conf.in b/src/nse/nse.conf.in index e8d7bd2ea..f3bd90e42 100644 --- a/src/nse/nse.conf.in +++ b/src/nse/nse.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [nse] | 1 | [nse] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | FORCESTART = YES | 3 | IMMEDIATE_START = YES |
4 | @JAVAPORT@PORT = 2097 | 4 | @JAVAPORT@PORT = 2097 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-nse | 6 | BINARY = gnunet-service-nse |
diff --git a/src/nse/nse_infiniband.conf b/src/nse/nse_infiniband.conf index 9904ca711..d2c97567d 100644 --- a/src/nse/nse_infiniband.conf +++ b/src/nse/nse_infiniband.conf | |||
@@ -2,7 +2,7 @@ | |||
2 | GNUNET_TEST_HOME = $GNUNET_TMP/nse-profiler/ | 2 | GNUNET_TEST_HOME = $GNUNET_TMP/nse-profiler/ |
3 | 3 | ||
4 | [testbed] | 4 | [testbed] |
5 | AUTOSTART = NO | 5 | START_ON_DEMAND = NO |
6 | ORT = 12113 | 6 | ORT = 12113 |
7 | ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16; 192.168.0.0/16; | 7 | ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16; 192.168.0.0/16; |
8 | HOSTNAME = localhost | 8 | HOSTNAME = localhost |
@@ -14,7 +14,7 @@ SETUP_TIMEOUT = 30m | |||
14 | STATS_DIR= /home/totakura/nse/test/load | 14 | STATS_DIR= /home/totakura/nse/test/load |
15 | 15 | ||
16 | [nse] | 16 | [nse] |
17 | FORCESTART = YES | 17 | IMMEDIATE_START = YES |
18 | # Overriding network settings for faster testing (do NOT use | 18 | # Overriding network settings for faster testing (do NOT use |
19 | # these values in production just because they are here) | 19 | # these values in production just because they are here) |
20 | WORKDELAY = 60 s | 20 | WORKDELAY = 60 s |
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf index ad5da536b..f702faae2 100644 --- a/src/nse/nse_profiler_test.conf +++ b/src/nse/nse_profiler_test.conf | |||
@@ -2,7 +2,7 @@ | |||
2 | GNUNET_TEST_HOME = $GNUNET_TMP/nse-profiler/ | 2 | GNUNET_TEST_HOME = $GNUNET_TMP/nse-profiler/ |
3 | 3 | ||
4 | [testbed] | 4 | [testbed] |
5 | AUTOSTART = NO | 5 | START_ON_DEMAND = NO |
6 | PORT = 12113 | 6 | PORT = 12113 |
7 | ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16; | 7 | ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16; |
8 | HOSTNAME = localhost | 8 | HOSTNAME = localhost |
@@ -12,8 +12,8 @@ OVERLAY_RANDOM_LINKS = 1000 | |||
12 | OPERATION_TIMEOUT = 45 s | 12 | OPERATION_TIMEOUT = 45 s |
13 | 13 | ||
14 | [nse] | 14 | [nse] |
15 | FORCESTART = YES | 15 | IMMEDIATE_START = YES |
16 | AUTOSTART = NO | 16 | START_ON_DEMAND = NO |
17 | # Overriding network settings for faster testing (do NOT use | 17 | # Overriding network settings for faster testing (do NOT use |
18 | # these values in production just because they are here) | 18 | # these values in production just because they are here) |
19 | WORKDELAY = 60 s | 19 | WORKDELAY = 60 s |
diff --git a/src/nse/test_nse.conf b/src/nse/test_nse.conf index 8331c241c..22866acfa 100644 --- a/src/nse/test_nse.conf +++ b/src/nse/test_nse.conf | |||
@@ -3,7 +3,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-nse-multipeer/ | |||
3 | 3 | ||
4 | [nse] | 4 | [nse] |
5 | #PREFIX = valgrind --leak-check=full --log-file=valgrind_nse.%p | 5 | #PREFIX = valgrind --leak-check=full --log-file=valgrind_nse.%p |
6 | FORCESTART = YES | 6 | IMMEDIATE_START = YES |
7 | PROOFFILE = $GNUNET_TEST_HOME/proof.nse | 7 | PROOFFILE = $GNUNET_TEST_HOME/proof.nse |
8 | # Overriding network settings for faster testing (do NOT use | 8 | # Overriding network settings for faster testing (do NOT use |
9 | # these values in production just because they are here) | 9 | # these values in production just because they are here) |
diff --git a/src/peerinfo/peerinfo.conf.in b/src/peerinfo/peerinfo.conf.in index 8615a8866..14a41655b 100644 --- a/src/peerinfo/peerinfo.conf.in +++ b/src/peerinfo/peerinfo.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [peerinfo] | 1 | [peerinfo] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2090 | 3 | @JAVAPORT@PORT = 2090 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-peerinfo | 5 | BINARY = gnunet-service-peerinfo |
diff --git a/src/peerinfo/test_peerinfo_api_data.conf b/src/peerinfo/test_peerinfo_api_data.conf index 1522d4dfe..e632c341f 100644 --- a/src/peerinfo/test_peerinfo_api_data.conf +++ b/src/peerinfo/test_peerinfo_api_data.conf | |||
@@ -5,11 +5,11 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-peerinfo/ | |||
5 | PORT = 22354 | 5 | PORT = 22354 |
6 | 6 | ||
7 | [dns] | 7 | [dns] |
8 | AUTOSTART = NO | 8 | START_ON_DEMAND = NO |
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | [nse] | 12 | [nse] |
13 | AUTOSTART = NO | 13 | START_ON_DEMAND = NO |
14 | 14 | ||
15 | 15 | ||
diff --git a/src/peerstore/peerstore.conf.in b/src/peerstore/peerstore.conf.in index a39b61887..a3a7c672b 100644 --- a/src/peerstore/peerstore.conf.in +++ b/src/peerstore/peerstore.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [peerstore] | 1 | [peerstore] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2110 | 3 | @JAVAPORT@PORT = 2110 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-peerstore | 5 | BINARY = gnunet-service-peerstore |
diff --git a/src/peerstore/test_peerstore_api_data.conf b/src/peerstore/test_peerstore_api_data.conf index 802418fa0..3ebda50eb 100644 --- a/src/peerstore/test_peerstore_api_data.conf +++ b/src/peerstore/test_peerstore_api_data.conf | |||
@@ -2,7 +2,7 @@ | |||
2 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-peerstore | 2 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-peerstore |
3 | 3 | ||
4 | [peerstore] | 4 | [peerstore] |
5 | AUTOSTART = YES | 5 | START_ON_DEMAND = YES |
6 | BINARY = gnunet-service-peerstore | 6 | BINARY = gnunet-service-peerstore |
7 | UNIXPATH = $GNUNET_TMP/gnunet-service-peerstore.sock | 7 | UNIXPATH = $GNUNET_TMP/gnunet-service-peerstore.sock |
8 | HOME = $SERVICEHOME | 8 | HOME = $SERVICEHOME |
diff --git a/src/psyc/Makefile.am b/src/psyc/Makefile.am index 61618d176..26db608f3 100644 --- a/src/psyc/Makefile.am +++ b/src/psyc/Makefile.am | |||
@@ -58,13 +58,13 @@ AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PAT | |||
58 | TESTS = $(check_PROGRAMS) | 58 | TESTS = $(check_PROGRAMS) |
59 | endif | 59 | endif |
60 | 60 | ||
61 | test_psyc_SOURCES = \ | 61 | #test_psyc_SOURCES = \ |
62 | test_psyc.c | 62 | # test_psyc.c |
63 | test_psyc_LDADD = \ | 63 | #test_psyc_LDADD = \ |
64 | libgnunetpsyc.la \ | 64 | # libgnunetpsyc.la \ |
65 | $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ | 65 | # $(top_builddir)/src/psycutil/libgnunetpsycutil.la \ |
66 | $(top_builddir)/src/testing/libgnunettesting.la \ | 66 | # $(top_builddir)/src/testing/libgnunettesting.la \ |
67 | $(top_builddir)/src/util/libgnunetutil.la | 67 | # $(top_builddir)/src/util/libgnunetutil.la |
68 | test_psyc2_SOURCES = \ | 68 | test_psyc2_SOURCES = \ |
69 | test_psyc2.c | 69 | test_psyc2.c |
70 | test_psyc2_LDADD = \ | 70 | test_psyc2_LDADD = \ |
diff --git a/src/psyc/psyc.conf.in b/src/psyc/psyc.conf.in index 4a4a96954..764ccfa84 100644 --- a/src/psyc/psyc.conf.in +++ b/src/psyc/psyc.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [psyc] | 1 | [psyc] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-psyc | 3 | BINARY = gnunet-service-psyc |
4 | 4 | ||
5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-psyc.sock | 5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-psyc.sock |
diff --git a/src/psyc/test_psyc.conf b/src/psyc/test_psyc.conf index 4e2563a8a..6ff031f0d 100644 --- a/src/psyc/test_psyc.conf +++ b/src/psyc/test_psyc.conf | |||
@@ -16,13 +16,13 @@ ID_ANNOUNCE_TIME = 5 s | |||
16 | ENABLE_UPNP = NO | 16 | ENABLE_UPNP = NO |
17 | 17 | ||
18 | [psyc] | 18 | [psyc] |
19 | FORCESTART = YES | 19 | IMMEDIATE_START = YES |
20 | AUTOSTART = YES | 20 | START_ON_DEMAND = YES |
21 | 21 | ||
22 | [multicast] | 22 | [multicast] |
23 | FORCESTART = YES | 23 | IMMEDIATE_START = YES |
24 | AUTOSTART = YES | 24 | START_ON_DEMAND = YES |
25 | 25 | ||
26 | [psycstore] | 26 | [psycstore] |
27 | FORCESTART = YES | 27 | IMMEDIATE_START = YES |
28 | AUTOSTART = YES | 28 | START_ON_DEMAND = YES |
diff --git a/src/psycstore/psycstore.conf.in b/src/psycstore/psycstore.conf.in index 82e9e67c2..3905db173 100644 --- a/src/psycstore/psycstore.conf.in +++ b/src/psycstore/psycstore.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [psycstore] | 1 | [psycstore] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-psycstore | 3 | BINARY = gnunet-service-psycstore |
4 | 4 | ||
5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-psycstore.sock | 5 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-psycstore.sock |
diff --git a/src/pt/test_gns_vpn.conf b/src/pt/test_gns_vpn.conf index c603b7422..85dd08113 100644 --- a/src/pt/test_gns_vpn.conf +++ b/src/pt/test_gns_vpn.conf | |||
@@ -7,11 +7,11 @@ PLUGINS = tcp | |||
7 | [arm] | 7 | [arm] |
8 | PORT = 0 | 8 | PORT = 0 |
9 | ALLOW_SHUTDOWN = YES | 9 | ALLOW_SHUTDOWN = YES |
10 | SYSTEM_ONLY = NO | 10 | START_SYSTEM_SERVICES = NO |
11 | USER_ONLY = NO | 11 | START_USER_SERVICES = NO |
12 | 12 | ||
13 | [exit] | 13 | [exit] |
14 | FORCESTART = YES | 14 | IMMEDIATE_START = YES |
15 | IPV6ADDR = FC5A:04E1:C2BA::1 | 15 | IPV6ADDR = FC5A:04E1:C2BA::1 |
16 | IPV6PREFIX = 96 | 16 | IPV6PREFIX = 96 |
17 | IPV4ADDR = 169.254.86.1 | 17 | IPV4ADDR = 169.254.86.1 |
@@ -25,19 +25,19 @@ EXIT_IFNAME = eth1 | |||
25 | 25 | ||
26 | [dns] | 26 | [dns] |
27 | DNS_EXIT = 8.8.8.8 | 27 | DNS_EXIT = 8.8.8.8 |
28 | FORCESTART = YES | 28 | IMMEDIATE_START = YES |
29 | 29 | ||
30 | [identity] | 30 | [identity] |
31 | AUTOSTART = YES | 31 | START_ON_DEMAND = YES |
32 | FORCESTART = YES | 32 | IMMEDIATE_START = YES |
33 | 33 | ||
34 | [hostlist] | 34 | [hostlist] |
35 | AUTOSTART = NO | 35 | START_ON_DEMAND = NO |
36 | FORCESTART = NO | 36 | IMMEDIATE_START = NO |
37 | 37 | ||
38 | [zonemaster] | 38 | [zonemaster] |
39 | AUTOSTART = YES | 39 | START_ON_DEMAND = YES |
40 | FORCESTART = YES | 40 | IMMEDIATE_START = YES |
41 | 41 | ||
42 | #[vpn] | 42 | #[vpn] |
43 | #PREFIX = valgrind | 43 | #PREFIX = valgrind |
@@ -61,15 +61,15 @@ TCP_REDIRECTS = 80:localhost4:8080 | |||
61 | TTL = 3600000 | 61 | TTL = 3600000 |
62 | 62 | ||
63 | [gns] | 63 | [gns] |
64 | AUTOSTART = YES | 64 | START_ON_DEMAND = YES |
65 | ZONEKEY = $GNUNET_TEST_HOME/.zonekey | 65 | ZONEKEY = $GNUNET_TEST_HOME/.zonekey |
66 | 66 | ||
67 | # Delays starting of GNS, as we need to first | 67 | # Delays starting of GNS, as we need to first |
68 | # setup the identity subsystem properly. | 68 | # setup the identity subsystem properly. |
69 | FORCESTART = NO | 69 | IMMEDIATE_START = NO |
70 | 70 | ||
71 | [namestore] | 71 | [namestore] |
72 | AUTOSTART = YES | 72 | START_ON_DEMAND = YES |
73 | 73 | ||
74 | [nat] | 74 | [nat] |
75 | USE_LOCALADDR = YES | 75 | USE_LOCALADDR = YES |
diff --git a/src/pt/test_gnunet_vpn.conf b/src/pt/test_gnunet_vpn.conf index c22cd3409..9bee93e02 100644 --- a/src/pt/test_gnunet_vpn.conf +++ b/src/pt/test_gnunet_vpn.conf | |||
@@ -9,7 +9,7 @@ PORT = 0 | |||
9 | ALLOW_SHUTDOWN = YES | 9 | ALLOW_SHUTDOWN = YES |
10 | 10 | ||
11 | [exit] | 11 | [exit] |
12 | FORCESTART = YES | 12 | IMMEDIATE_START = YES |
13 | EXIT_IPV4 = YES | 13 | EXIT_IPV4 = YES |
14 | EXIT_IPV6 = YES | 14 | EXIT_IPV6 = YES |
15 | IPV6ADDR = FC5A:04E1:C2BA::1 | 15 | IPV6ADDR = FC5A:04E1:C2BA::1 |
@@ -21,8 +21,8 @@ IPV4MASK = 255.255.255.0 | |||
21 | EXIT_IFNAME = eth1 | 21 | EXIT_IFNAME = eth1 |
22 | 22 | ||
23 | [hostlist] | 23 | [hostlist] |
24 | AUTOSTART = NO | 24 | START_ON_DEMAND = NO |
25 | FORCESTART = NO | 25 | IMMEDIATE_START = NO |
26 | 26 | ||
27 | [nse] | 27 | [nse] |
28 | WORKBITS = 1 | 28 | WORKBITS = 1 |
@@ -38,11 +38,11 @@ IPV4MASK = 255.255.255.0 | |||
38 | 38 | ||
39 | 39 | ||
40 | [gns] | 40 | [gns] |
41 | AUTOSTART = NO | 41 | START_ON_DEMAND = NO |
42 | 42 | ||
43 | [nat] | 43 | [nat] |
44 | USE_LOCALADDR = YES | 44 | USE_LOCALADDR = YES |
45 | RETURN_LOCAL_ADDRESSES = YES | 45 | RETURN_LOCAL_ADDRESSES = YES |
46 | 46 | ||
47 | [consensus] | 47 | [consensus] |
48 | AUTOSTART = NO | 48 | START_ON_DEMAND = NO |
diff --git a/src/regex/regex.conf.in b/src/regex/regex.conf.in index 8a75881f9..5e68a43da 100644 --- a/src/regex/regex.conf.in +++ b/src/regex/regex.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [regex] | 1 | [regex] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@ PORT = 2107 | 3 | @UNIXONLY@ PORT = 2107 |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-regex.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-regex.sock |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
diff --git a/src/regex/test_regex_api_data.conf b/src/regex/test_regex_api_data.conf index 60dcdc0b6..40fee1e54 100644 --- a/src/regex/test_regex_api_data.conf +++ b/src/regex/test_regex_api_data.conf | |||
@@ -19,11 +19,11 @@ WAN_QUOTA_IN = 1 GB | |||
19 | WAN_QUOTA_OUT = 1 GB | 19 | WAN_QUOTA_OUT = 1 GB |
20 | 20 | ||
21 | [dht] | 21 | [dht] |
22 | AUTOSTART = YES | 22 | START_ON_DEMAND = YES |
23 | PORT = 12370 | 23 | PORT = 12370 |
24 | 24 | ||
25 | [regex] | 25 | [regex] |
26 | AUTOSTART = YES | 26 | START_ON_DEMAND = YES |
27 | 27 | ||
28 | [transport] | 28 | [transport] |
29 | plugins = tcp | 29 | plugins = tcp |
diff --git a/src/revocation/revocation.conf.in b/src/revocation/revocation.conf.in index 333f2e488..d7ad174c9 100644 --- a/src/revocation/revocation.conf.in +++ b/src/revocation/revocation.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [revocation] | 1 | [revocation] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | FORCESTART = YES | 3 | IMMEDIATE_START = YES |
4 | @JAVAPORT@PORT = 2112 | 4 | @JAVAPORT@PORT = 2112 |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | BINARY = gnunet-service-revocation | 6 | BINARY = gnunet-service-revocation |
diff --git a/src/revocation/test_revocation.conf b/src/revocation/test_revocation.conf index 14ecf6064..3b04150c1 100644 --- a/src/revocation/test_revocation.conf +++ b/src/revocation/test_revocation.conf | |||
@@ -6,7 +6,7 @@ SERVICEHOME=$GNUNET_TMP/test-revocation-service | |||
6 | 6 | ||
7 | [revocation] | 7 | [revocation] |
8 | WORKBITS = 3 | 8 | WORKBITS = 3 |
9 | FORCESTART = YES | 9 | IMMEDIATE_START = YES |
10 | 10 | ||
11 | [identity] | 11 | [identity] |
12 | # Directory where we store information about our egos | 12 | # Directory where we store information about our egos |
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index 4a7a89b15..b43ce2fa2 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c | |||
@@ -48,12 +48,6 @@ static unsigned bits_needed; | |||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * How long do we run the test? | 50 | * How long do we run the test? |
51 | * In seconds. | ||
52 | */ | ||
53 | static uint32_t timeout_s; | ||
54 | |||
55 | /** | ||
56 | * How long do we run the test? | ||
57 | */ | 51 | */ |
58 | //#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | 52 | //#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
59 | static struct GNUNET_TIME_Relative timeout; | 53 | static struct GNUNET_TIME_Relative timeout; |
@@ -948,6 +942,8 @@ post_test_op (void *cls) | |||
948 | if (NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics || | 942 | if (NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics || |
949 | GNUNET_YES == check_statistics_collect_completed()) | 943 | GNUNET_YES == check_statistics_collect_completed()) |
950 | { | 944 | { |
945 | GNUNET_SCHEDULER_cancel (shutdown_task); | ||
946 | shutdown_task = GNUNET_SCHEDULER_add_now (&shutdown_op, NULL); | ||
951 | GNUNET_SCHEDULER_shutdown (); | 947 | GNUNET_SCHEDULER_shutdown (); |
952 | } | 948 | } |
953 | } | 949 | } |
@@ -2570,10 +2566,9 @@ test_run (void *cls, | |||
2570 | if (NULL != churn_task) | 2566 | if (NULL != churn_task) |
2571 | GNUNET_SCHEDULER_cancel (churn_task); | 2567 | GNUNET_SCHEDULER_cancel (churn_task); |
2572 | post_test_task = GNUNET_SCHEDULER_add_delayed (timeout, &post_test_op, NULL); | 2568 | post_test_task = GNUNET_SCHEDULER_add_delayed (timeout, &post_test_op, NULL); |
2573 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 2569 | timeout = GNUNET_TIME_relative_multiply (timeout, 1 + (0.1 * num_peers)); |
2574 | (timeout_s * 1.2) + 0.1 * num_peers); | ||
2575 | shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); | ||
2576 | shutdown_task = GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL); | 2570 | shutdown_task = GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL); |
2571 | shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); | ||
2577 | 2572 | ||
2578 | } | 2573 | } |
2579 | 2574 | ||
@@ -2598,7 +2593,7 @@ run (void *cls, | |||
2598 | 2593 | ||
2599 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n"); | 2594 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n"); |
2600 | cur_test_run.name = "test-rps-profiler"; | 2595 | cur_test_run.name = "test-rps-profiler"; |
2601 | num_peers = 10; | 2596 | if (0 == num_peers) num_peers = 10; |
2602 | mal_type = 3; | 2597 | mal_type = 3; |
2603 | cur_test_run.init_peer = profiler_init_peer; | 2598 | cur_test_run.init_peer = profiler_init_peer; |
2604 | //cur_test_run.pre_test = mal_pre; | 2599 | //cur_test_run.pre_test = mal_pre; |
@@ -2608,7 +2603,7 @@ run (void *cls, | |||
2608 | cur_test_run.eval_cb = profiler_eval; | 2603 | cur_test_run.eval_cb = profiler_eval; |
2609 | cur_test_run.post_test = post_profiler; | 2604 | cur_test_run.post_test = post_profiler; |
2610 | cur_test_run.request_interval = 2; | 2605 | cur_test_run.request_interval = 2; |
2611 | cur_test_run.num_requests = 5; | 2606 | if (0 == cur_test_run.num_requests) cur_test_run.num_requests = 5; |
2612 | //cur_test_run.have_churn = HAVE_CHURN; | 2607 | //cur_test_run.have_churn = HAVE_CHURN; |
2613 | cur_test_run.have_churn = HAVE_NO_CHURN; | 2608 | cur_test_run.have_churn = HAVE_NO_CHURN; |
2614 | cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; | 2609 | cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; |
@@ -2630,20 +2625,22 @@ run (void *cls, | |||
2630 | BIT(STAT_TYPE_RECV_PULL_REQ) | | 2625 | BIT(STAT_TYPE_RECV_PULL_REQ) | |
2631 | BIT(STAT_TYPE_RECV_PULL_REP); | 2626 | BIT(STAT_TYPE_RECV_PULL_REP); |
2632 | cur_test_run.have_collect_view = COLLECT_VIEW; | 2627 | cur_test_run.have_collect_view = COLLECT_VIEW; |
2633 | timeout_s = 300; | ||
2634 | 2628 | ||
2635 | /* 'Clean' directory */ | 2629 | /* 'Clean' directory */ |
2636 | (void) GNUNET_DISK_directory_remove ("/tmp/rps/"); | 2630 | (void) GNUNET_DISK_directory_remove ("/tmp/rps/"); |
2637 | GNUNET_DISK_directory_create ("/tmp/rps/"); | 2631 | GNUNET_DISK_directory_create ("/tmp/rps/"); |
2638 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, timeout_s); | 2632 | if (0 == timeout.rel_value_us) |
2633 | { | ||
2634 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); | ||
2635 | } | ||
2639 | 2636 | ||
2640 | /* Compute number of bits for representing largest peer id */ | 2637 | /* Compute number of bits for representing largest peer id */ |
2641 | for (bits_needed = 1; (bits_needed << 1) < num_peers - 1; bits_needed++) | 2638 | for (bits_needed = 1; (1 << bits_needed) < num_peers; bits_needed++) |
2642 | ; | 2639 | ; |
2643 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2640 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2644 | "Need %u bits to represent largest peer id %" PRIu32 "\n", | 2641 | "Need %u bits to represent %" PRIu32 " peers\n", |
2645 | bits_needed, | 2642 | bits_needed, |
2646 | num_peers - 1); | 2643 | num_peers); |
2647 | 2644 | ||
2648 | rps_peers = GNUNET_new_array (num_peers, struct RPSPeer); | 2645 | rps_peers = GNUNET_new_array (num_peers, struct RPSPeer); |
2649 | peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers, GNUNET_NO); | 2646 | peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers, GNUNET_NO); |
@@ -2686,10 +2683,23 @@ main (int argc, char *argv[]) | |||
2686 | int ret_value; | 2683 | int ret_value; |
2687 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 2684 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
2688 | GNUNET_GETOPT_option_uint ('n', | 2685 | GNUNET_GETOPT_option_uint ('n', |
2689 | "peers", | 2686 | "num-peers", |
2690 | "COUNT", | 2687 | "COUNT", |
2691 | gettext_noop ("number of peers to start"), | 2688 | gettext_noop ("number of peers to start"), |
2692 | &num_peers), | 2689 | &num_peers), |
2690 | |||
2691 | GNUNET_GETOPT_option_relative_time ('t', | ||
2692 | "timeout", | ||
2693 | "TIMEOUT", | ||
2694 | gettext_noop ("timeout for the profiling"), | ||
2695 | &timeout), | ||
2696 | |||
2697 | GNUNET_GETOPT_option_uint ('r', | ||
2698 | "num-requests", | ||
2699 | "COUNT", | ||
2700 | gettext_noop ("number of PeerIDs to request"), | ||
2701 | &cur_test_run.num_requests), | ||
2702 | |||
2693 | GNUNET_GETOPT_OPTION_END | 2703 | GNUNET_GETOPT_OPTION_END |
2694 | }; | 2704 | }; |
2695 | 2705 | ||
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 9e81330bd..1b9681663 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -69,6 +69,12 @@ static struct GNUNET_STATISTICS_Handle *stats; | |||
69 | static struct GNUNET_PeerIdentity own_identity; | 69 | static struct GNUNET_PeerIdentity own_identity; |
70 | 70 | ||
71 | 71 | ||
72 | /** | ||
73 | * @brief Port used for cadet. | ||
74 | * | ||
75 | * Don't compute multiple times through making it global | ||
76 | */ | ||
77 | static struct GNUNET_HashCode port; | ||
72 | 78 | ||
73 | /*********************************************************************** | 79 | /*********************************************************************** |
74 | * Old gnunet-service-rps_peers.c | 80 | * Old gnunet-service-rps_peers.c |
@@ -578,7 +584,6 @@ struct GNUNET_CADET_Channel * | |||
578 | get_channel (const struct GNUNET_PeerIdentity *peer) | 584 | get_channel (const struct GNUNET_PeerIdentity *peer) |
579 | { | 585 | { |
580 | struct PeerContext *peer_ctx; | 586 | struct PeerContext *peer_ctx; |
581 | struct GNUNET_HashCode port; | ||
582 | struct GNUNET_PeerIdentity *ctx_peer; | 587 | struct GNUNET_PeerIdentity *ctx_peer; |
583 | /* There exists a copy-paste-clone in run() */ | 588 | /* There exists a copy-paste-clone in run() */ |
584 | struct GNUNET_MQ_MessageHandler cadet_handlers[] = { | 589 | struct GNUNET_MQ_MessageHandler cadet_handlers[] = { |
@@ -608,9 +613,6 @@ get_channel (const struct GNUNET_PeerIdentity *peer) | |||
608 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 613 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
609 | "Trying to establish channel to peer %s\n", | 614 | "Trying to establish channel to peer %s\n", |
610 | GNUNET_i2s (peer)); | 615 | GNUNET_i2s (peer)); |
611 | GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_RPS, | ||
612 | strlen (GNUNET_APPLICATION_PORT_RPS), | ||
613 | &port); | ||
614 | ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity); | 616 | ctx_peer = GNUNET_new (struct GNUNET_PeerIdentity); |
615 | *ctx_peer = *peer; | 617 | *ctx_peer = *peer; |
616 | peer_ctx->send_channel = | 618 | peer_ctx->send_channel = |
@@ -3164,7 +3166,6 @@ handle_peer_check (void *cls, | |||
3164 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 3166 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
3165 | "Received CHECK_LIVE (%s)\n", GNUNET_i2s (peer)); | 3167 | "Received CHECK_LIVE (%s)\n", GNUNET_i2s (peer)); |
3166 | 3168 | ||
3167 | GNUNET_break_op (Peers_check_peer_known (peer)); | ||
3168 | GNUNET_CADET_receive_done (Peers_get_recv_channel (peer)); | 3169 | GNUNET_CADET_receive_done (Peers_get_recv_channel (peer)); |
3169 | } | 3170 | } |
3170 | 3171 | ||
@@ -4247,7 +4248,6 @@ run (void *cls, | |||
4247 | struct GNUNET_SERVICE_Handle *service) | 4248 | struct GNUNET_SERVICE_Handle *service) |
4248 | { | 4249 | { |
4249 | char* fn_valid_peers; | 4250 | char* fn_valid_peers; |
4250 | struct GNUNET_HashCode port; | ||
4251 | 4251 | ||
4252 | GNUNET_log_setup ("rps", GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_DEBUG), NULL); | 4252 | GNUNET_log_setup ("rps", GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_DEBUG), NULL); |
4253 | cfg = c; | 4253 | cfg = c; |
diff --git a/src/rps/rps.conf.in b/src/rps/rps.conf.in index 733b72601..7f0a419bd 100644 --- a/src/rps/rps.conf.in +++ b/src/rps/rps.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [rps] | 1 | [rps] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-rps | 3 | BINARY = gnunet-service-rps |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-rps.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-rps.sock |
5 | HOME = $SERVICEHOME | 5 | HOME = $SERVICEHOME |
diff --git a/src/rps/test_rps.conf b/src/rps/test_rps.conf index e4ed111e2..05bb9f444 100644 --- a/src/rps/test_rps.conf +++ b/src/rps/test_rps.conf | |||
@@ -5,8 +5,8 @@ UNIXPATH = $GNUNET_TMP/gnunet-service-rps.sock | |||
5 | HOME = $SERVICEHOME | 5 | HOME = $SERVICEHOME |
6 | # PORT = 2106 | 6 | # PORT = 2106 |
7 | #@UNIXONLY@ PORT = 2087 | 7 | #@UNIXONLY@ PORT = 2087 |
8 | FORCESTART = YES | 8 | IMMEDIATE_START = YES |
9 | AUTOSTART = NO | 9 | START_ON_DEMAND = NO |
10 | NOARMBIND = YES | 10 | NOARMBIND = YES |
11 | #OPTIONS=-l /tmp/rps_profiler_logs/rps-[]-%Y-%m-%d.log | 11 | #OPTIONS=-l /tmp/rps_profiler_logs/rps-[]-%Y-%m-%d.log |
12 | 12 | ||
@@ -21,17 +21,24 @@ FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt | |||
21 | # So, 50 is enough for a network of size 50^3 = 125000 | 21 | # So, 50 is enough for a network of size 50^3 = 125000 |
22 | MINSIZE = 4 | 22 | MINSIZE = 4 |
23 | 23 | ||
24 | |||
25 | |||
24 | [testbed] | 26 | [testbed] |
25 | HOSTNAME = localhost | 27 | HOSTNAME = localhost |
26 | 28 | ||
27 | # OPERATION_TIMEOUT = 60 s | ||
28 | |||
29 | # MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 100 | 29 | # MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 100 |
30 | OVERLAY_TOPOLOGY = CLIQUE | ||
31 | #OVERLAY_TOPOLOGY = SMALL_WORLD | ||
32 | #SCALE_FREE_TOPOLOGY_CAP = | ||
33 | 30 | ||
34 | # OVERLAY_RANDOM_LINKS = 25 | 31 | #OVERLAY_TOPOLOGY = CLIQUE |
32 | |||
33 | OVERLAY_TOPOLOGY = SCALE_FREE | ||
34 | SCALE_FREE_TOPOLOGY_CAP = 100 | ||
35 | SCALE_FREE_TOPOLOGY_M = 2 | ||
36 | |||
37 | #OVERLAY_TOPOLOGY = RANDOM | ||
38 | #OVERLAY_RANDOM_LINKS = 25 | ||
39 | |||
40 | #OVERLAY_TOPOLOGY = SMALL_WORLD | ||
41 | #OVERLAY_RANDOM_LINKS = 25 | ||
35 | 42 | ||
36 | SETUP_TIMEOUT = 2 m | 43 | SETUP_TIMEOUT = 2 m |
37 | 44 | ||
@@ -41,12 +48,13 @@ WORKBITS = 0 | |||
41 | [nat] | 48 | [nat] |
42 | # Use addresses from the local network interfaces (inluding loopback, but also others) | 49 | # Use addresses from the local network interfaces (inluding loopback, but also others) |
43 | USE_LOCALADDR = YES | 50 | USE_LOCALADDR = YES |
51 | ENABLE_UPNP = NO | ||
44 | 52 | ||
45 | # Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8) | 53 | # Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8) |
46 | RETURN_LOCAL_ADDRESSES = YES | 54 | RETURN_LOCAL_ADDRESSES = YES |
47 | 55 | ||
48 | [transport] | 56 | [transport] |
49 | PLUGINS = udp | 57 | PLUGINS = unix |
50 | 58 | ||
51 | [ats] | 59 | [ats] |
52 | # Network specific inbound/outbound quotas | 60 | # Network specific inbound/outbound quotas |
@@ -72,7 +80,6 @@ BLUETOOTH_QUOTA_OUT = unlimited | |||
72 | DISABLE_TRY_CONNECT = YES | 80 | DISABLE_TRY_CONNECT = YES |
73 | 81 | ||
74 | [cadet] | 82 | [cadet] |
75 | DISABLE_TRY_CONNECT = YES | ||
76 | #OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log | 83 | #OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log |
77 | #PREFIX = valgrind | 84 | #PREFIX = valgrind |
78 | 85 | ||
@@ -80,44 +87,44 @@ DISABLE_TRY_CONNECT = YES | |||
80 | #GLOBAL_POSTFIX=-l /tmp/rps_profiler_logs/other-[]-%Y-%m-%d.log | 87 | #GLOBAL_POSTFIX=-l /tmp/rps_profiler_logs/other-[]-%Y-%m-%d.log |
81 | 88 | ||
82 | #[statistics] | 89 | #[statistics] |
83 | #FORCESTART = NO | 90 | #IMMEDIATE_START = NO |
84 | #AUTOSTART = NO | 91 | #START_ON_DEMAND = NO |
85 | 92 | ||
86 | [peerinfo] | 93 | [peerinfo] |
87 | NO_IO = YES | 94 | NO_IO = YES |
88 | 95 | ||
89 | [hostlist] | 96 | [hostlist] |
90 | FORCESTART = NO | 97 | IMMEDIATE_START = NO |
91 | AUTOSTART = NO | 98 | START_ON_DEMAND = NO |
92 | 99 | ||
93 | [zonemaster] | 100 | [zonemaster] |
94 | FORCESTART = NO | 101 | IMMEDIATE_START = NO |
95 | AUTOSTART = NO | 102 | START_ON_DEMAND = NO |
96 | 103 | ||
97 | [namecache] | 104 | [namecache] |
98 | FORCESTART = NO | 105 | IMMEDIATE_START = NO |
99 | AUTOSTART = NO | 106 | START_ON_DEMAND = NO |
100 | 107 | ||
101 | [namestore] | 108 | [namestore] |
102 | FORCESTART = NO | 109 | IMMEDIATE_START = NO |
103 | AUTOSTART = NO | 110 | START_ON_DEMAND = NO |
104 | 111 | ||
105 | [topology] | 112 | [topology] |
106 | FORCESTART = NO | 113 | IMMEDIATE_START = NO |
107 | AUTOSTART = NO | 114 | START_ON_DEMAND = NO |
108 | 115 | ||
109 | [vpn] | 116 | [vpn] |
110 | FORCESTART = NO | 117 | IMMEDIATE_START = NO |
111 | AUTOSTART = NO | 118 | START_ON_DEMAND = NO |
112 | 119 | ||
113 | [revocation] | 120 | [revocation] |
114 | FORCESTART = NO | 121 | IMMEDIATE_START = NO |
115 | AUTOSTART = NO | 122 | START_ON_DEMAND = NO |
116 | 123 | ||
117 | [gns] | 124 | [gns] |
118 | FORCESTART = NO | 125 | IMMEDIATE_START = NO |
119 | AUTOSTART = NO | 126 | START_ON_DEMAND = NO |
120 | 127 | ||
121 | [fs] | 128 | [fs] |
122 | FORCESTART = NO | 129 | IMMEDIATE_START = NO |
123 | AUTOSTART = NO | 130 | START_ON_DEMAND = NO |
diff --git a/src/scalarproduct/scalarproduct.conf.in b/src/scalarproduct/scalarproduct.conf.in index e2a0c7ad7..e2286b076 100644 --- a/src/scalarproduct/scalarproduct.conf.in +++ b/src/scalarproduct/scalarproduct.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [scalarproduct-alice] | 1 | [scalarproduct-alice] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-scalarproduct-ecc-alice | 3 | BINARY = gnunet-service-scalarproduct-ecc-alice |
4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-alice.sock | 4 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-alice.sock |
5 | @UNIXONLY@ PORT = 2117 | 5 | @UNIXONLY@ PORT = 2117 |
@@ -12,7 +12,7 @@ UNIX_MATCH_GID = YES | |||
12 | 12 | ||
13 | 13 | ||
14 | [scalarproduct-bob] | 14 | [scalarproduct-bob] |
15 | AUTOSTART = @AUTOSTART@ | 15 | START_ON_DEMAND = @START_ON_DEMAND@ |
16 | HOSTNAME = localhost | 16 | HOSTNAME = localhost |
17 | BINARY = gnunet-service-scalarproduct-ecc-bob | 17 | BINARY = gnunet-service-scalarproduct-ecc-bob |
18 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-bob.sock | 18 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-scalarproduct-bob.sock |
diff --git a/src/secretsharing/secretsharing.conf.in b/src/secretsharing/secretsharing.conf.in index 0834235d4..bd8da6177 100644 --- a/src/secretsharing/secretsharing.conf.in +++ b/src/secretsharing/secretsharing.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [secretsharing] | 1 | [secretsharing] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | @JAVAPORT@PORT = 2114 | 3 | @JAVAPORT@PORT = 2114 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-secretsharing | 5 | BINARY = gnunet-service-secretsharing |
diff --git a/src/secretsharing/test_secretsharing.conf b/src/secretsharing/test_secretsharing.conf index 9980666cd..3391c88db 100644 --- a/src/secretsharing/test_secretsharing.conf +++ b/src/secretsharing/test_secretsharing.conf | |||
@@ -1,10 +1,10 @@ | |||
1 | [secretsharing] | 1 | [secretsharing] |
2 | AUTOSTART = YES | 2 | START_ON_DEMAND = YES |
3 | #PREFIX = valgrind --leak-check=full | 3 | #PREFIX = valgrind --leak-check=full |
4 | OPTIONS = -LINFO | 4 | OPTIONS = -LINFO |
5 | 5 | ||
6 | [consensus] | 6 | [consensus] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | 8 | ||
9 | [transport] | 9 | [transport] |
10 | OPTIONS = -LERROR | 10 | OPTIONS = -LERROR |
@@ -12,7 +12,7 @@ PLUGINS = unix | |||
12 | 12 | ||
13 | [set] | 13 | [set] |
14 | OPTIONS = -L INFO | 14 | OPTIONS = -L INFO |
15 | AUTOSTART = YES | 15 | START_ON_DEMAND = YES |
16 | #PREFIX = valgrind --leak-check=full | 16 | #PREFIX = valgrind --leak-check=full |
17 | 17 | ||
18 | [testbed] | 18 | [testbed] |
@@ -32,5 +32,5 @@ DISABLEV6 = NO | |||
32 | RETURN_LOCAL_ADDRESSES = YES | 32 | RETURN_LOCAL_ADDRESSES = YES |
33 | 33 | ||
34 | [nse] | 34 | [nse] |
35 | AUTOSTART = NO | 35 | START_ON_DEMAND = NO |
36 | 36 | ||
diff --git a/src/set/set.conf.in b/src/set/set.conf.in index deaa07efb..66bcfa169 100644 --- a/src/set/set.conf.in +++ b/src/set/set.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [set] | 1 | [set] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@PORT = 2106 | 3 | @UNIXONLY@PORT = 2106 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-set | 5 | BINARY = gnunet-service-set |
diff --git a/src/set/test_set.conf b/src/set/test_set.conf index 02afd2ec5..21fe984f8 100644 --- a/src/set/test_set.conf +++ b/src/set/test_set.conf | |||
@@ -4,7 +4,7 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-set/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-set/ |
5 | 5 | ||
6 | [set] | 6 | [set] |
7 | AUTOSTART = YES | 7 | START_ON_DEMAND = YES |
8 | #PREFIX = valgrind --leak-check=full | 8 | #PREFIX = valgrind --leak-check=full |
9 | #PREFIX = gdbserver :1234 | 9 | #PREFIX = gdbserver :1234 |
10 | OPTIONS = -L INFO | 10 | OPTIONS = -L INFO |
diff --git a/src/social/social.conf.in b/src/social/social.conf.in index 33b14e5b4..3fe754c80 100644 --- a/src/social/social.conf.in +++ b/src/social/social.conf.in | |||
@@ -1,7 +1,7 @@ | |||
1 | [social] | 1 | [social] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | BINARY = gnunet-service-social | 3 | BINARY = gnunet-service-social |
4 | USER_SERVICE = YES | 4 | RUN_PER_USER = YES |
5 | 5 | ||
6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-social.sock | 6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-social.sock |
7 | UNIX_MATCH_UID = YES | 7 | UNIX_MATCH_UID = YES |
diff --git a/src/social/test_social.conf b/src/social/test_social.conf index df9815fd2..bc487760f 100644 --- a/src/social/test_social.conf +++ b/src/social/test_social.conf | |||
@@ -4,7 +4,7 @@ | |||
4 | GNUNET_TEST_HOME = $GNUNET_TMP/gnunet-test-social/ | 4 | GNUNET_TEST_HOME = $GNUNET_TMP/gnunet-test-social/ |
5 | 5 | ||
6 | [social] | 6 | [social] |
7 | FORCESTART = YES | 7 | IMMEDIATE_START = YES |
8 | 8 | ||
9 | [transport] | 9 | [transport] |
10 | PLUGINS = tcp | 10 | PLUGINS = tcp |
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 648fc89bb..a92faa3d7 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c | |||
@@ -39,6 +39,11 @@ static int ret; | |||
39 | static char *subsystem; | 39 | static char *subsystem; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * The path of the testbed data. | ||
43 | */ | ||
44 | static char *path_testbed; | ||
45 | |||
46 | /** | ||
42 | * Set to the specific stat value that we are after (or NULL for all). | 47 | * Set to the specific stat value that we are after (or NULL for all). |
43 | */ | 48 | */ |
44 | static char *name; | 49 | static char *name; |
@@ -59,6 +64,11 @@ static int watch; | |||
59 | static int quiet; | 64 | static int quiet; |
60 | 65 | ||
61 | /** | 66 | /** |
67 | * @brief Separator string for csv. | ||
68 | */ | ||
69 | static char *csv_separator; | ||
70 | |||
71 | /** | ||
62 | * Remote host | 72 | * Remote host |
63 | */ | 73 | */ |
64 | static char *remote_host; | 74 | static char *remote_host; |
@@ -79,10 +89,169 @@ static unsigned long long set_val; | |||
79 | static int set_value; | 89 | static int set_value; |
80 | 90 | ||
81 | /** | 91 | /** |
82 | * Handle for pending GET operation. | 92 | * @brief Representation of all (testbed) nodes. |
93 | */ | ||
94 | static struct Node { | ||
95 | /** | ||
96 | * @brief Index of the node in this array. | ||
97 | */ | ||
98 | unsigned index_node; | ||
99 | |||
100 | /** | ||
101 | * @brief Configuration handle for this node | ||
102 | */ | ||
103 | struct GNUNET_CONFIGURATION_Handle *conf; | ||
104 | |||
105 | /** | ||
106 | * Handle for pending GET operation. | ||
107 | */ | ||
108 | struct GNUNET_STATISTICS_GetHandle *gh; | ||
109 | |||
110 | /** | ||
111 | * @brief Statistics handle nodes. | ||
112 | */ | ||
113 | struct GNUNET_STATISTICS_Handle *handle; | ||
114 | /** | ||
115 | * @brief Identifier for shutdown task for this node. | ||
116 | */ | ||
117 | struct GNUNET_SCHEDULER_Task *shutdown_task; | ||
118 | } *nodes; | ||
119 | |||
120 | /** | ||
121 | * @brief Number of configurations of all (testbed) nodes. | ||
122 | */ | ||
123 | static unsigned num_nodes; | ||
124 | |||
125 | /** | ||
126 | * @brief Set of values for a combination of subsystem and name. | ||
127 | */ | ||
128 | struct ValueSet | ||
129 | { | ||
130 | /** | ||
131 | * @brief Subsystem of the valueset. | ||
132 | */ | ||
133 | char *subsystem; | ||
134 | |||
135 | /** | ||
136 | * @brief Name of the valueset. | ||
137 | */ | ||
138 | char *name; | ||
139 | |||
140 | /** | ||
141 | * @brief The values. | ||
142 | */ | ||
143 | uint64_t *values; | ||
144 | |||
145 | /** | ||
146 | * @brief Persistence of the values. | ||
147 | */ | ||
148 | int is_persistent; | ||
149 | }; | ||
150 | |||
151 | /** | ||
152 | * @brief Collection of all values (represented with #ValueSet). | ||
153 | */ | ||
154 | static struct GNUNET_CONTAINER_MultiHashMap *values; | ||
155 | |||
156 | /** | ||
157 | * @brief Number of nodes that have their values ready. | ||
158 | */ | ||
159 | static int num_nodes_ready; | ||
160 | |||
161 | /** | ||
162 | * @brief Number of nodes that have their values ready. | ||
163 | */ | ||
164 | static int num_nodes_ready_shutdown; | ||
165 | |||
166 | /** | ||
167 | * @brief Create a new #ValueSet | ||
168 | * | ||
169 | * @param subsystem Subsystem of the valueset. | ||
170 | * @param name Name of the valueset. | ||
171 | * @param num_values Number of values in valueset - number of peers. | ||
172 | * @param is_persistent Persistence status of values. | ||
173 | * | ||
174 | * @return Newly allocated #ValueSet. | ||
83 | */ | 175 | */ |
84 | static struct GNUNET_STATISTICS_GetHandle *gh; | 176 | static struct ValueSet * |
177 | new_value_set (const char *subsystem, | ||
178 | const char *name, | ||
179 | unsigned num_values, | ||
180 | int is_persistent) | ||
181 | { | ||
182 | struct ValueSet *value_set; | ||
183 | |||
184 | value_set = GNUNET_new (struct ValueSet); | ||
185 | value_set->subsystem = GNUNET_strdup (subsystem); | ||
186 | value_set->name = GNUNET_strdup (name); | ||
187 | value_set->values = GNUNET_new_array (num_values, uint64_t); | ||
188 | value_set->is_persistent = persistent; | ||
189 | return value_set; | ||
190 | } | ||
85 | 191 | ||
192 | /** | ||
193 | * @brief Print the (collected) values. | ||
194 | * | ||
195 | * Implements #GNUNET_CONTAINER_HashMapIterator. | ||
196 | * | ||
197 | * @param cls Closure - unused | ||
198 | * @param key #GNUNET_HashCode key of #GNUNET_CONTAINER_MultiHashMap iterator - | ||
199 | * unused | ||
200 | * @param value Values represented as #ValueSet. | ||
201 | * | ||
202 | * @return GNUNET_YES - continue iteration. | ||
203 | */ | ||
204 | static int | ||
205 | printer (void *cls, | ||
206 | const struct GNUNET_HashCode *key, | ||
207 | void *value) | ||
208 | { | ||
209 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); | ||
210 | const char *now_str; | ||
211 | struct ValueSet *value_set = value; | ||
212 | |||
213 | if (quiet == GNUNET_NO) | ||
214 | { | ||
215 | if (GNUNET_YES == watch) | ||
216 | { | ||
217 | now_str = GNUNET_STRINGS_absolute_time_to_string (now); | ||
218 | FPRINTF (stdout, | ||
219 | "%24s%s %s%s%12s%s %50s%s ", | ||
220 | now_str, | ||
221 | csv_separator, | ||
222 | value_set->is_persistent ? "!" : " ", | ||
223 | csv_separator, | ||
224 | value_set->subsystem, | ||
225 | csv_separator, | ||
226 | _(value_set->name), | ||
227 | (0 == strlen (csv_separator) ? ":": csv_separator)); | ||
228 | } | ||
229 | else | ||
230 | { | ||
231 | FPRINTF (stdout, | ||
232 | "%s%s%12s%s %50s%s ", | ||
233 | value_set->is_persistent ? "!" : " ", | ||
234 | csv_separator, | ||
235 | value_set->subsystem, | ||
236 | csv_separator, | ||
237 | _(value_set->name), | ||
238 | (0 == strlen (csv_separator) ? ":": csv_separator)); | ||
239 | } | ||
240 | } | ||
241 | for (unsigned i = 0; i < num_nodes; i++) | ||
242 | { | ||
243 | FPRINTF (stdout, | ||
244 | "%16llu%s", | ||
245 | (unsigned long long) value_set->values[i], | ||
246 | csv_separator); | ||
247 | } | ||
248 | FPRINTF (stdout, "\n"); | ||
249 | GNUNET_free (value_set->subsystem); | ||
250 | GNUNET_free (value_set->name); | ||
251 | GNUNET_free (value_set->values); | ||
252 | GNUNET_free (value_set); | ||
253 | return GNUNET_YES; | ||
254 | } | ||
86 | 255 | ||
87 | /** | 256 | /** |
88 | * Callback function to process statistic values. | 257 | * Callback function to process statistic values. |
@@ -95,11 +264,11 @@ static struct GNUNET_STATISTICS_GetHandle *gh; | |||
95 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration | 264 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration |
96 | */ | 265 | */ |
97 | static int | 266 | static int |
98 | printer (void *cls, | 267 | printer_watch (void *cls, |
99 | const char *subsystem, | 268 | const char *subsystem, |
100 | const char *name, | 269 | const char *name, |
101 | uint64_t value, | 270 | uint64_t value, |
102 | int is_persistent) | 271 | int is_persistent) |
103 | { | 272 | { |
104 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); | 273 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); |
105 | const char *now_str; | 274 | const char *now_str; |
@@ -110,21 +279,28 @@ printer (void *cls, | |||
110 | { | 279 | { |
111 | now_str = GNUNET_STRINGS_absolute_time_to_string (now); | 280 | now_str = GNUNET_STRINGS_absolute_time_to_string (now); |
112 | FPRINTF (stdout, | 281 | FPRINTF (stdout, |
113 | "%24s %s%12s %50s: %16llu\n", | 282 | "%24s%s %s%s%12s%s %50s%s %16llu\n", |
114 | now_str, | 283 | now_str, |
284 | csv_separator, | ||
115 | is_persistent ? "!" : " ", | 285 | is_persistent ? "!" : " ", |
286 | csv_separator, | ||
116 | subsystem, | 287 | subsystem, |
117 | _(name), | 288 | csv_separator, |
118 | (unsigned long long) value); | 289 | _(name), |
290 | (0 == strlen (csv_separator) ? ":": csv_separator), | ||
291 | (unsigned long long) value); | ||
119 | } | 292 | } |
120 | else | 293 | else |
121 | { | 294 | { |
122 | FPRINTF (stdout, | 295 | FPRINTF (stdout, |
123 | "%s%12s %50s: %16llu\n", | 296 | "%s%s%12s%s %50s%s %16llu\n", |
124 | is_persistent ? "!" : " ", | 297 | is_persistent ? "!" : " ", |
298 | csv_separator, | ||
125 | subsystem, | 299 | subsystem, |
126 | _(name), | 300 | csv_separator, |
127 | (unsigned long long) value); | 301 | _(name), |
302 | (0 == strlen (csv_separator) ? ":": csv_separator), | ||
303 | (unsigned long long) value); | ||
128 | } | 304 | } |
129 | } | 305 | } |
130 | else | 306 | else |
@@ -135,6 +311,111 @@ printer (void *cls, | |||
135 | return GNUNET_OK; | 311 | return GNUNET_OK; |
136 | } | 312 | } |
137 | 313 | ||
314 | /** | ||
315 | * @brief Clean all data structures related to given node. | ||
316 | * | ||
317 | * Also clears global structures if we are the last node to clean. | ||
318 | * | ||
319 | * @param cls the index of the node | ||
320 | */ | ||
321 | static void | ||
322 | clean_node (void *cls) | ||
323 | { | ||
324 | const unsigned index_node = *(unsigned *) cls; | ||
325 | struct GNUNET_STATISTICS_Handle *h; | ||
326 | struct GNUNET_STATISTICS_GetHandle *gh; | ||
327 | |||
328 | if ( (NULL != path_testbed) && /* were issued with -t <testbed-path> option */ | ||
329 | (NULL != nodes[index_node].conf) ) | ||
330 | { | ||
331 | GNUNET_CONFIGURATION_destroy (nodes[index_node].conf); | ||
332 | nodes[index_node].conf = NULL; | ||
333 | } | ||
334 | |||
335 | h = nodes[index_node].handle; | ||
336 | gh = nodes[index_node].gh; | ||
337 | |||
338 | if (NULL != gh) | ||
339 | { | ||
340 | GNUNET_STATISTICS_get_cancel (gh); | ||
341 | gh = NULL; | ||
342 | } | ||
343 | if (GNUNET_YES == watch) | ||
344 | { | ||
345 | GNUNET_assert (GNUNET_OK == | ||
346 | GNUNET_STATISTICS_watch_cancel (h, | ||
347 | subsystem, | ||
348 | name, | ||
349 | &printer_watch, | ||
350 | &nodes[index_node].index_node)); | ||
351 | } | ||
352 | |||
353 | if (NULL != h) | ||
354 | { | ||
355 | GNUNET_STATISTICS_destroy (h, GNUNET_NO); | ||
356 | h = NULL; | ||
357 | } | ||
358 | |||
359 | num_nodes_ready_shutdown++; | ||
360 | if (num_nodes == num_nodes_ready_shutdown) | ||
361 | { | ||
362 | GNUNET_array_grow (nodes, num_nodes, 0); | ||
363 | GNUNET_CONTAINER_multihashmap_destroy (values); | ||
364 | } | ||
365 | } | ||
366 | |||
367 | /** | ||
368 | * @brief Print and shutdown | ||
369 | * | ||
370 | * @param cls unused | ||
371 | */ | ||
372 | static void | ||
373 | print_finish (void *cls) | ||
374 | { | ||
375 | GNUNET_CONTAINER_multihashmap_iterate (values, printer, NULL); | ||
376 | GNUNET_SCHEDULER_shutdown(); | ||
377 | } | ||
378 | |||
379 | /** | ||
380 | * @brief Called once all statistic values are available. | ||
381 | * | ||
382 | * Implements #GNUNET_STATISTICS_Callback | ||
383 | * | ||
384 | * @param cls Closure - The index of the node. | ||
385 | * @param succes Whether statistics were obtained successfully. | ||
386 | */ | ||
387 | static void | ||
388 | continuation_print (void *cls, | ||
389 | int success) | ||
390 | { | ||
391 | const unsigned index_node = *(unsigned *) cls; | ||
392 | |||
393 | nodes[index_node].gh = NULL; | ||
394 | if (GNUNET_OK != success) | ||
395 | { | ||
396 | if (NULL == remote_host) | ||
397 | FPRINTF (stderr, | ||
398 | "%s", | ||
399 | _("Failed to obtain statistics.\n")); | ||
400 | else | ||
401 | FPRINTF (stderr, | ||
402 | _("Failed to obtain statistics from host `%s:%llu'\n"), | ||
403 | remote_host, | ||
404 | remote_port); | ||
405 | ret = 1; | ||
406 | } | ||
407 | if (NULL != nodes[index_node].shutdown_task) | ||
408 | { | ||
409 | GNUNET_SCHEDULER_cancel (nodes[index_node].shutdown_task); | ||
410 | nodes[index_node].shutdown_task = NULL; | ||
411 | } | ||
412 | GNUNET_SCHEDULER_add_now (clean_node, &nodes[index_node].index_node); | ||
413 | num_nodes_ready++; | ||
414 | if (num_nodes_ready == num_nodes) | ||
415 | { | ||
416 | GNUNET_SCHEDULER_add_now (print_finish, NULL); | ||
417 | } | ||
418 | } | ||
138 | 419 | ||
139 | /** | 420 | /** |
140 | * Function called last by the statistics code. | 421 | * Function called last by the statistics code. |
@@ -147,7 +428,10 @@ static void | |||
147 | cleanup (void *cls, | 428 | cleanup (void *cls, |
148 | int success) | 429 | int success) |
149 | { | 430 | { |
150 | gh = NULL; | 431 | for (unsigned i = 0; i < num_nodes; i++) |
432 | { | ||
433 | nodes[i].gh = NULL; | ||
434 | } | ||
151 | if (GNUNET_OK != success) | 435 | if (GNUNET_OK != success) |
152 | { | 436 | { |
153 | if (NULL == remote_host) | 437 | if (NULL == remote_host) |
@@ -164,39 +448,56 @@ cleanup (void *cls, | |||
164 | GNUNET_SCHEDULER_shutdown (); | 448 | GNUNET_SCHEDULER_shutdown (); |
165 | } | 449 | } |
166 | 450 | ||
167 | |||
168 | /** | 451 | /** |
169 | * Function run on shutdown to clean up. | 452 | * @brief Iterate over statistics values and store them in #values. |
453 | * They will be printed once all are available. | ||
170 | * | 454 | * |
171 | * @param cls the statistics handle | 455 | * @param cls Cosure - Node index. |
456 | * @param subsystem Subsystem of the value. | ||
457 | * @param name Name of the value. | ||
458 | * @param value Value itself. | ||
459 | * @param is_persistent Persistence. | ||
460 | * | ||
461 | * @return GNUNET_OK - continue. | ||
172 | */ | 462 | */ |
173 | static void | 463 | static int |
174 | shutdown_task (void *cls) | 464 | collector (void *cls, |
465 | const char *subsystem, | ||
466 | const char *name, | ||
467 | uint64_t value, | ||
468 | int is_persistent) | ||
175 | { | 469 | { |
176 | struct GNUNET_STATISTICS_Handle *h = cls; | 470 | const unsigned index_node = *(unsigned *) cls; |
177 | 471 | struct GNUNET_HashCode *key; | |
178 | if (NULL == h) | 472 | struct GNUNET_HashCode hc; |
179 | return; | 473 | char *subsys_name; |
180 | if (NULL != gh) | 474 | unsigned len_subsys_name; |
475 | struct ValueSet *value_set; | ||
476 | |||
477 | len_subsys_name = strlen (subsystem) + 3 + strlen (name) + 1; | ||
478 | subsys_name = GNUNET_malloc (len_subsys_name); | ||
479 | SPRINTF (subsys_name, "%s---%s", subsystem, name); | ||
480 | key = &hc; | ||
481 | GNUNET_CRYPTO_hash (subsys_name, len_subsys_name, key); | ||
482 | GNUNET_free (subsys_name); | ||
483 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (values, key)) | ||
181 | { | 484 | { |
182 | GNUNET_STATISTICS_get_cancel (gh); | 485 | // get |
183 | gh = NULL; | 486 | value_set = GNUNET_CONTAINER_multihashmap_get (values, key); |
184 | } | 487 | } |
185 | if ( (GNUNET_YES == watch) && | 488 | else |
186 | (NULL != subsystem) && | 489 | { |
187 | (NULL != name) ) | 490 | // new |
188 | GNUNET_assert (GNUNET_OK == | 491 | value_set = new_value_set (subsystem, name, num_nodes, is_persistent); |
189 | GNUNET_STATISTICS_watch_cancel (h, | 492 | } |
190 | subsystem, | 493 | // write |
191 | name, | 494 | value_set->values[index_node] = value; |
192 | &printer, | 495 | // put |
193 | h)); | 496 | GNUNET_CONTAINER_multihashmap_put (values, key, value_set, |
194 | GNUNET_STATISTICS_destroy (h, | 497 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
195 | GNUNET_NO); | 498 | return GNUNET_OK; |
196 | h = NULL; | ||
197 | } | 499 | } |
198 | 500 | ||
199 | |||
200 | /** | 501 | /** |
201 | * Main task that does the actual work. | 502 | * Main task that does the actual work. |
202 | * | 503 | * |
@@ -205,8 +506,8 @@ shutdown_task (void *cls) | |||
205 | static void | 506 | static void |
206 | main_task (void *cls) | 507 | main_task (void *cls) |
207 | { | 508 | { |
208 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; | 509 | unsigned index_node = *(unsigned *) cls; |
209 | struct GNUNET_STATISTICS_Handle *h; | 510 | const struct GNUNET_CONFIGURATION_Handle *cfg = nodes[index_node].conf; |
210 | 511 | ||
211 | if (set_value) | 512 | if (set_value) |
212 | { | 513 | { |
@@ -226,23 +527,23 @@ main_task (void *cls) | |||
226 | ret = 1; | 527 | ret = 1; |
227 | return; | 528 | return; |
228 | } | 529 | } |
229 | h = GNUNET_STATISTICS_create (subsystem, | 530 | nodes[index_node].handle = GNUNET_STATISTICS_create (subsystem, |
230 | cfg); | 531 | cfg); |
231 | if (NULL == h) | 532 | if (NULL == nodes[index_node].handle) |
232 | { | 533 | { |
233 | ret = 1; | 534 | ret = 1; |
234 | return; | 535 | return; |
235 | } | 536 | } |
236 | GNUNET_STATISTICS_set (h, | 537 | GNUNET_STATISTICS_set (nodes[index_node].handle, |
237 | name, | 538 | name, |
238 | (uint64_t) set_val, | 539 | (uint64_t) set_val, |
239 | persistent); | 540 | persistent); |
240 | GNUNET_STATISTICS_destroy (h, | 541 | GNUNET_STATISTICS_destroy (nodes[index_node].handle, |
241 | GNUNET_YES); | 542 | GNUNET_YES); |
242 | h = NULL; | 543 | nodes[index_node].handle = NULL; |
243 | return; | 544 | return; |
244 | } | 545 | } |
245 | if (NULL == (h = GNUNET_STATISTICS_create ("gnunet-statistics", | 546 | if (NULL == (nodes[index_node].handle = GNUNET_STATISTICS_create ("gnunet-statistics", |
246 | cfg))) | 547 | cfg))) |
247 | { | 548 | { |
248 | ret = 1; | 549 | ret = 1; |
@@ -251,13 +552,13 @@ main_task (void *cls) | |||
251 | if (GNUNET_NO == watch) | 552 | if (GNUNET_NO == watch) |
252 | { | 553 | { |
253 | if (NULL == | 554 | if (NULL == |
254 | (gh = GNUNET_STATISTICS_get (h, | 555 | (nodes[index_node].gh = GNUNET_STATISTICS_get (nodes[index_node].handle, |
255 | subsystem, | 556 | subsystem, |
256 | name, | 557 | name, |
257 | &cleanup, | 558 | &continuation_print, |
258 | &printer, | 559 | &collector, |
259 | h)) ) | 560 | &nodes[index_node].index_node)) ) |
260 | cleanup (h, | 561 | cleanup (nodes[index_node].handle, |
261 | GNUNET_SYSERR); | 562 | GNUNET_SYSERR); |
262 | } | 563 | } |
263 | else | 564 | else |
@@ -266,30 +567,128 @@ main_task (void *cls) | |||
266 | (NULL == name) ) | 567 | (NULL == name) ) |
267 | { | 568 | { |
268 | printf (_("No subsystem or name given\n")); | 569 | printf (_("No subsystem or name given\n")); |
269 | GNUNET_STATISTICS_destroy (h, | 570 | GNUNET_STATISTICS_destroy (nodes[index_node].handle, |
270 | GNUNET_NO); | 571 | GNUNET_NO); |
271 | h = NULL; | 572 | nodes[index_node].handle = NULL; |
272 | ret = 1; | 573 | ret = 1; |
273 | return; | 574 | return; |
274 | } | 575 | } |
275 | if (GNUNET_OK != | 576 | if (GNUNET_OK != |
276 | GNUNET_STATISTICS_watch (h, | 577 | GNUNET_STATISTICS_watch (nodes[index_node].handle, |
277 | subsystem, | 578 | subsystem, |
278 | name, | 579 | name, |
279 | &printer, | 580 | &printer_watch, |
280 | h)) | 581 | &nodes[index_node].index_node)) |
281 | { | 582 | { |
282 | fprintf (stderr, | 583 | fprintf (stderr, |
283 | _("Failed to initialize watch routine\n")); | 584 | _("Failed to initialize watch routine\n")); |
284 | GNUNET_SCHEDULER_add_now (&shutdown_task, | 585 | nodes[index_node].shutdown_task = |
285 | h); | 586 | GNUNET_SCHEDULER_add_now (&clean_node, |
587 | &nodes[index_node].index_node); | ||
286 | return; | 588 | return; |
287 | } | 589 | } |
288 | } | 590 | } |
289 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 591 | nodes[index_node].shutdown_task = |
290 | h); | 592 | GNUNET_SCHEDULER_add_shutdown (&clean_node, |
593 | &nodes[index_node].index_node); | ||
291 | } | 594 | } |
292 | 595 | ||
596 | /** | ||
597 | * @brief Iter over content of a node's directory to check for existence of a | ||
598 | * config file. | ||
599 | * | ||
600 | * Implements #GNUNET_FileNameCallback | ||
601 | * | ||
602 | * @param cls pointer to indicate success | ||
603 | * @param filename filename inside the directory of the potential node | ||
604 | * | ||
605 | * @return to continue iteration or not to | ||
606 | */ | ||
607 | static int | ||
608 | iter_check_config (void *cls, | ||
609 | const char *filename) | ||
610 | { | ||
611 | if (0 == strncmp (GNUNET_STRINGS_get_short_name (filename), "config", 6)) | ||
612 | { | ||
613 | /* Found the config - stop iteration successfully */ | ||
614 | GNUNET_array_grow (nodes, num_nodes, num_nodes+1); | ||
615 | nodes[num_nodes-1].conf = GNUNET_CONFIGURATION_create(); | ||
616 | nodes[num_nodes-1].index_node = num_nodes-1; | ||
617 | if (GNUNET_OK != GNUNET_CONFIGURATION_load (nodes[num_nodes-1].conf, filename)) | ||
618 | { | ||
619 | FPRINTF (stderr, "Failed loading config `%s'\n", filename); | ||
620 | return GNUNET_SYSERR; | ||
621 | } | ||
622 | return GNUNET_NO; | ||
623 | } | ||
624 | else | ||
625 | { | ||
626 | /* Continue iteration */ | ||
627 | return GNUNET_OK; | ||
628 | } | ||
629 | } | ||
630 | |||
631 | /** | ||
632 | * @brief Iterates over filenames in testbed directory. | ||
633 | * | ||
634 | * Implements #GNUNET_FileNameCallback | ||
635 | * | ||
636 | * Checks if the file is a directory for a testbed node | ||
637 | * and counts the nodes. | ||
638 | * | ||
639 | * @param cls counter of nodes | ||
640 | * @param filename full path of the file in testbed | ||
641 | * | ||
642 | * @return status whether to continue iteration | ||
643 | */ | ||
644 | static int | ||
645 | iter_testbed_path (void *cls, | ||
646 | const char *filename) | ||
647 | { | ||
648 | unsigned index_node; | ||
649 | |||
650 | GNUNET_assert (NULL != filename); | ||
651 | if (1 == SSCANF (GNUNET_STRINGS_get_short_name (filename), | ||
652 | "%u", | ||
653 | &index_node)) | ||
654 | { | ||
655 | if (-1 == GNUNET_DISK_directory_scan (filename, | ||
656 | iter_check_config, | ||
657 | NULL)) | ||
658 | { | ||
659 | /* This is probably no directory for a testbed node | ||
660 | * Go on with iteration */ | ||
661 | return GNUNET_OK; | ||
662 | } | ||
663 | return GNUNET_OK; | ||
664 | } | ||
665 | return GNUNET_OK; | ||
666 | } | ||
667 | |||
668 | /** | ||
669 | * @brief Count the number of nodes running in the testbed | ||
670 | * | ||
671 | * @param path_testbed path to the testbed data | ||
672 | * | ||
673 | * @return number of running nodes | ||
674 | */ | ||
675 | static int | ||
676 | discover_testbed_nodes (const char *path_testbed) | ||
677 | { | ||
678 | int num_dir_entries; | ||
679 | |||
680 | num_dir_entries = GNUNET_DISK_directory_scan (path_testbed, | ||
681 | iter_testbed_path, | ||
682 | NULL); | ||
683 | if (-1 == num_dir_entries) | ||
684 | { | ||
685 | FPRINTF (stderr, | ||
686 | "Failure during scanning directory `%s'\n", | ||
687 | path_testbed); | ||
688 | return -1; | ||
689 | } | ||
690 | return 0; | ||
691 | } | ||
293 | 692 | ||
294 | /** | 693 | /** |
295 | * Main function that will be run by the scheduler. | 694 | * Main function that will be run by the scheduler. |
@@ -309,6 +708,7 @@ run (void *cls, | |||
309 | 708 | ||
310 | c = (struct GNUNET_CONFIGURATION_Handle *) cfg; | 709 | c = (struct GNUNET_CONFIGURATION_Handle *) cfg; |
311 | set_value = GNUNET_NO; | 710 | set_value = GNUNET_NO; |
711 | if (NULL == csv_separator) csv_separator = ""; | ||
312 | if (NULL != args[0]) | 712 | if (NULL != args[0]) |
313 | { | 713 | { |
314 | if (1 != SSCANF (args[0], | 714 | if (1 != SSCANF (args[0], |
@@ -361,8 +761,34 @@ run (void *cls, | |||
361 | "PORT", | 761 | "PORT", |
362 | remote_port); | 762 | remote_port); |
363 | } | 763 | } |
364 | GNUNET_SCHEDULER_add_now (&main_task, | 764 | if (NULL == path_testbed) |
365 | c); | 765 | { |
766 | values = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_NO); | ||
767 | GNUNET_array_grow (nodes, num_nodes, 1); | ||
768 | nodes[0].index_node = 0; | ||
769 | nodes[0].conf = c; | ||
770 | GNUNET_SCHEDULER_add_now (&main_task, &nodes[0].index_node); | ||
771 | } | ||
772 | else | ||
773 | { | ||
774 | if (GNUNET_YES == watch) | ||
775 | { | ||
776 | printf (_("Not able to watch testbed nodes (yet - feel free to implement)\n")); | ||
777 | ret = 1; | ||
778 | return; | ||
779 | } | ||
780 | values = GNUNET_CONTAINER_multihashmap_create (4, GNUNET_NO); | ||
781 | if (-1 == discover_testbed_nodes (path_testbed)) | ||
782 | { | ||
783 | return; | ||
784 | } | ||
785 | /* For each config/node collect statistics */ | ||
786 | for (unsigned i = 0; i < num_nodes; i++) | ||
787 | { | ||
788 | GNUNET_SCHEDULER_add_now (&main_task, | ||
789 | &nodes[i].index_node); | ||
790 | } | ||
791 | } | ||
366 | } | 792 | } |
367 | 793 | ||
368 | 794 | ||
@@ -394,6 +820,18 @@ main (int argc, char *const *argv) | |||
394 | gettext_noop ("limit output to the given SUBSYSTEM"), | 820 | gettext_noop ("limit output to the given SUBSYSTEM"), |
395 | &subsystem), | 821 | &subsystem), |
396 | 822 | ||
823 | GNUNET_GETOPT_option_string ('S', | ||
824 | "csv-separator", | ||
825 | "CSV_SEPARATOR", | ||
826 | gettext_noop ("use as csv separator"), | ||
827 | &csv_separator), | ||
828 | |||
829 | GNUNET_GETOPT_option_filename ('t', | ||
830 | "testbed", | ||
831 | "TESTBED", | ||
832 | gettext_noop ("path to the folder containing the testbed data"), | ||
833 | &path_testbed), | ||
834 | |||
397 | GNUNET_GETOPT_option_flag ('q', | 835 | GNUNET_GETOPT_option_flag ('q', |
398 | "quiet", | 836 | "quiet", |
399 | gettext_noop ("just print the statistics value"), | 837 | gettext_noop ("just print the statistics value"), |
@@ -409,11 +847,13 @@ main (int argc, char *const *argv) | |||
409 | "REMOTE", | 847 | "REMOTE", |
410 | gettext_noop ("connect to remote host"), | 848 | gettext_noop ("connect to remote host"), |
411 | &remote_host), | 849 | &remote_host), |
850 | |||
412 | GNUNET_GETOPT_option_ulong ('o', | 851 | GNUNET_GETOPT_option_ulong ('o', |
413 | "port", | 852 | "port", |
414 | "PORT", | 853 | "PORT", |
415 | gettext_noop ("port for remote host"), | 854 | gettext_noop ("port for remote host"), |
416 | &remote_port), | 855 | &remote_port), |
856 | |||
417 | GNUNET_GETOPT_OPTION_END | 857 | GNUNET_GETOPT_OPTION_END |
418 | }; | 858 | }; |
419 | remote_port = 0; | 859 | remote_port = 0; |
diff --git a/src/statistics/statistics.conf.in b/src/statistics/statistics.conf.in index 2d0011372..36aca538f 100644 --- a/src/statistics/statistics.conf.in +++ b/src/statistics/statistics.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [statistics] | 1 | [statistics] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2088 | 3 | @JAVAPORT@PORT = 2088 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-statistics | 5 | BINARY = gnunet-service-statistics |
diff --git a/src/template/template.conf b/src/template/template.conf index 8c8c179f7..e5f675a5d 100644 --- a/src/template/template.conf +++ b/src/template/template.conf | |||
@@ -1,5 +1,5 @@ | |||
1 | [template] | 1 | [template] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | PORT = 9999 | 3 | PORT = 9999 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-template | 5 | BINARY = gnunet-service-template |
diff --git a/src/testbed-logger/testbed-logger.conf.in b/src/testbed-logger/testbed-logger.conf.in index 05ef782ae..288bbed72 100644 --- a/src/testbed-logger/testbed-logger.conf.in +++ b/src/testbed-logger/testbed-logger.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [testbed] | 1 | [testbed] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | @JAVAPORT@ PORT = 2101 | 3 | @JAVAPORT@ PORT = 2101 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-testbed | 5 | BINARY = gnunet-service-testbed |
@@ -90,7 +90,7 @@ SHARED_SERVICES = | |||
90 | 90 | ||
91 | 91 | ||
92 | [testbed-logger] | 92 | [testbed-logger] |
93 | AUTOSTART = NO | 93 | START_ON_DEMAND = NO |
94 | @UNIXONLY@ PORT = 2102 | 94 | @UNIXONLY@ PORT = 2102 |
95 | HOSTNAME = localhost | 95 | HOSTNAME = localhost |
96 | BINARY = gnunet-service-testbed-logger | 96 | BINARY = gnunet-service-testbed-logger |
@@ -101,7 +101,7 @@ UNIX_MATCH_GID = YES | |||
101 | 101 | ||
102 | 102 | ||
103 | [testbed-barrier] | 103 | [testbed-barrier] |
104 | AUTOSTART = NO | 104 | START_ON_DEMAND = NO |
105 | @UNIXONLY@ PORT = 2103 | 105 | @UNIXONLY@ PORT = 2103 |
106 | HOSTNAME = localhost | 106 | HOSTNAME = localhost |
107 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed-barrier.sock | 107 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed-barrier.sock |
@@ -112,7 +112,7 @@ UNIX_MATCH_GID = YES | |||
112 | # This section is related to configuring underlay restrictions to simulate | 112 | # This section is related to configuring underlay restrictions to simulate |
113 | # connectivity restrictions of NAT boxes | 113 | # connectivity restrictions of NAT boxes |
114 | [testbed-underlay] | 114 | [testbed-underlay] |
115 | AUTOSTART = NO | 115 | START_ON_DEMAND = NO |
116 | NOARMBIND = YES | 116 | NOARMBIND = YES |
117 | BINARY = gnunet-daemon-testbed-underlay | 117 | BINARY = gnunet-daemon-testbed-underlay |
118 | # The sqlite3 database file containing information about what underlay | 118 | # The sqlite3 database file containing information about what underlay |
@@ -120,8 +120,8 @@ BINARY = gnunet-daemon-testbed-underlay | |||
120 | # DBFILE = | 120 | # DBFILE = |
121 | 121 | ||
122 | [latency-logger] | 122 | [latency-logger] |
123 | AUTOSTART = NO | 123 | START_ON_DEMAND = NO |
124 | NOARMBIND = YES | 124 | NOARMBIND = YES |
125 | BINARY = gnunet-daemon-latency-logger | 125 | BINARY = gnunet-daemon-latency-logger |
126 | # The sqlite3 database file where the latency values are to be stored | 126 | # The sqlite3 database file where the latency values are to be stored |
127 | # DBFILE = \ No newline at end of file | 127 | # DBFILE = |
diff --git a/src/testbed/test_testbed_api_barriers.conf.in b/src/testbed/test_testbed_api_barriers.conf.in index 8cad6df09..ac0c9c400 100644 --- a/src/testbed/test_testbed_api_barriers.conf.in +++ b/src/testbed/test_testbed_api_barriers.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [testbed] | 1 | [testbed] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | PORT = 12113 | 3 | PORT = 12113 |
4 | ACCEPT_FROM = 127.0.0.1; | 4 | ACCEPT_FROM = 127.0.0.1; |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
@@ -10,26 +10,26 @@ TOPOLOGY = RANDOM | |||
10 | PORT = 12366 | 10 | PORT = 12366 |
11 | 11 | ||
12 | [test-barriers] | 12 | [test-barriers] |
13 | AUTOSTART = NO | 13 | START_ON_DEMAND = NO |
14 | PORT = 12114 | 14 | PORT = 12114 |
15 | BINARY = /will/be/overwriten/in/test_testbed_api_barriers/ | 15 | BINARY = /will/be/overwriten/in/test_testbed_api_barriers/ |
16 | FORCESTART = YES | 16 | IMMEDIATE_START = YES |
17 | 17 | ||
18 | [fs] | 18 | [fs] |
19 | AUTOSTART = NO | 19 | START_ON_DEMAND = NO |
20 | FORCESTART = NO | 20 | IMMEDIATE_START = NO |
21 | 21 | ||
22 | [resolver] | 22 | [resolver] |
23 | HOSTNAME = localhost | 23 | HOSTNAME = localhost |
24 | AUTOSTART = NO | 24 | START_ON_DEMAND = NO |
25 | 25 | ||
26 | [cadet] | 26 | [cadet] |
27 | AUTOSTART = NO | 27 | START_ON_DEMAND = NO |
28 | FORCESTART = NO | 28 | IMMEDIATE_START = NO |
29 | 29 | ||
30 | [dht] | 30 | [dht] |
31 | AUTOSTART = NO | 31 | START_ON_DEMAND = NO |
32 | FORCESTART = NO | 32 | IMMEDIATE_START = NO |
33 | 33 | ||
34 | [dhtcache] | 34 | [dhtcache] |
35 | QUOTA = 1 MB | 35 | QUOTA = 1 MB |
@@ -41,7 +41,7 @@ ACCEPT_FROM6 = ::1; | |||
41 | ACCEPT_FROM = 127.0.0.1; | 41 | ACCEPT_FROM = 127.0.0.1; |
42 | NEIGHBOUR_LIMIT = 50 | 42 | NEIGHBOUR_LIMIT = 50 |
43 | PORT = 12365 | 43 | PORT = 12365 |
44 | FORCESTART = YES | 44 | IMMEDIATE_START = YES |
45 | 45 | ||
46 | [ats] | 46 | [ats] |
47 | WAN_QUOTA_OUT = 3932160 | 47 | WAN_QUOTA_OUT = 3932160 |
@@ -49,8 +49,8 @@ WAN_QUOTA_IN = 3932160 | |||
49 | 49 | ||
50 | [core] | 50 | [core] |
51 | PORT = 12092 | 51 | PORT = 12092 |
52 | AUTOSTART = YES | 52 | START_ON_DEMAND = YES |
53 | FORCESTART = YES | 53 | IMMEDIATE_START = YES |
54 | USE_EPHEMERAL_KEYS = NO | 54 | USE_EPHEMERAL_KEYS = NO |
55 | 55 | ||
56 | [transport-udp] | 56 | [transport-udp] |
@@ -61,43 +61,43 @@ PORT = 12368 | |||
61 | GNUNET_TEST_HOME = $GNUNET_TMP/test-testbed/ | 61 | GNUNET_TEST_HOME = $GNUNET_TMP/test-testbed/ |
62 | 62 | ||
63 | [dns] | 63 | [dns] |
64 | AUTOSTART = NO | 64 | START_ON_DEMAND = NO |
65 | FORCESTART = NO | 65 | IMMEDIATE_START = NO |
66 | 66 | ||
67 | [nse] | 67 | [nse] |
68 | AUTOSTART = NO | 68 | START_ON_DEMAND = NO |
69 | FORCESTART = NO | 69 | IMMEDIATE_START = NO |
70 | 70 | ||
71 | [vpn] | 71 | [vpn] |
72 | AUTOSTART = NO | 72 | START_ON_DEMAND = NO |
73 | FORCESTART = NO | 73 | IMMEDIATE_START = NO |
74 | 74 | ||
75 | [nat] | 75 | [nat] |
76 | RETURN_LOCAL_ADDRESSES = YES | 76 | RETURN_LOCAL_ADDRESSES = YES |
77 | FORCESTART = NO | 77 | IMMEDIATE_START = NO |
78 | 78 | ||
79 | [gns-helper-service-w32] | 79 | [gns-helper-service-w32] |
80 | AUTOSTART = NO | 80 | START_ON_DEMAND = NO |
81 | 81 | ||
82 | [consensus] | 82 | [consensus] |
83 | AUTOSTART = NO | 83 | START_ON_DEMAND = NO |
84 | FORCESTART = NO | 84 | IMMEDIATE_START = NO |
85 | 85 | ||
86 | [gns] | 86 | [gns] |
87 | AUTOSTART = NO | 87 | START_ON_DEMAND = NO |
88 | FORCESTART = NO | 88 | IMMEDIATE_START = NO |
89 | 89 | ||
90 | [statistics] | 90 | [statistics] |
91 | AUTOSTART = NO | 91 | START_ON_DEMAND = NO |
92 | FORCESTART = NO | 92 | IMMEDIATE_START = NO |
93 | 93 | ||
94 | [peerinfo] | 94 | [peerinfo] |
95 | NO_IO = YES | 95 | NO_IO = YES |
96 | 96 | ||
97 | [set] | 97 | [set] |
98 | AUTOSTART = NO | 98 | START_ON_DEMAND = NO |
99 | FORCESTART = NO | 99 | IMMEDIATE_START = NO |
100 | 100 | ||
101 | [revocation] | 101 | [revocation] |
102 | AUTOSTART = NO | 102 | START_ON_DEMAND = NO |
103 | FORCESTART = NO \ No newline at end of file | 103 | IMMEDIATE_START = NO |
diff --git a/src/testbed/test_testbed_api_statistics.conf b/src/testbed/test_testbed_api_statistics.conf index 65366835d..50d3f2c04 100644 --- a/src/testbed/test_testbed_api_statistics.conf +++ b/src/testbed/test_testbed_api_statistics.conf | |||
@@ -5,5 +5,5 @@ OVERLAY_TOPOLOGY = 2D_TORUS | |||
5 | MAX_PARALLEL_SERVICE_CONNECTIONS = 2 | 5 | MAX_PARALLEL_SERVICE_CONNECTIONS = 2 |
6 | 6 | ||
7 | [statistics] | 7 | [statistics] |
8 | AUTOSTART = YES | 8 | START_ON_DEMAND = YES |
9 | PORT = 30 | 9 | PORT = 30 |
diff --git a/src/testbed/test_testbed_api_template.conf b/src/testbed/test_testbed_api_template.conf index 049829842..381c1bd85 100644 --- a/src/testbed/test_testbed_api_template.conf +++ b/src/testbed/test_testbed_api_template.conf | |||
@@ -2,7 +2,7 @@ | |||
2 | @INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf | 2 | @INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf |
3 | 3 | ||
4 | [testbed] | 4 | [testbed] |
5 | AUTOSTART = NO | 5 | START_ON_DEMAND = NO |
6 | PORT = 12113 | 6 | PORT = 12113 |
7 | ACCEPT_FROM = 127.0.0.1; | 7 | ACCEPT_FROM = 127.0.0.1; |
8 | HOSTNAME = localhost | 8 | HOSTNAME = localhost |
@@ -18,11 +18,11 @@ PLUGINS = udp | |||
18 | ACCEPT_FROM6 = ::1; | 18 | ACCEPT_FROM6 = ::1; |
19 | ACCEPT_FROM = 127.0.0.1; | 19 | ACCEPT_FROM = 127.0.0.1; |
20 | NEIGHBOUR_LIMIT = 50 | 20 | NEIGHBOUR_LIMIT = 50 |
21 | FORCESTART = YES | 21 | IMMEDIATE_START = YES |
22 | 22 | ||
23 | # Transport requires resolver when connecting to a peer, so enable it | 23 | # Transport requires resolver when connecting to a peer, so enable it |
24 | [resolver] | 24 | [resolver] |
25 | AUTOSTART = YES | 25 | START_ON_DEMAND = YES |
26 | 26 | ||
27 | [ats] | 27 | [ats] |
28 | WAN_QUOTA_OUT = 3932160 | 28 | WAN_QUOTA_OUT = 3932160 |
@@ -30,7 +30,7 @@ WAN_QUOTA_IN = 3932160 | |||
30 | 30 | ||
31 | [core] | 31 | [core] |
32 | USE_EPHEMERAL_KEYS = NO | 32 | USE_EPHEMERAL_KEYS = NO |
33 | FORCESTART = YES | 33 | IMMEDIATE_START = YES |
34 | 34 | ||
35 | [transport-udp] | 35 | [transport-udp] |
36 | TIMEOUT = 300 s | 36 | TIMEOUT = 300 s |
diff --git a/src/testbed/test_testbed_underlay.conf.in b/src/testbed/test_testbed_underlay.conf.in index 5799b5253..1916cc59d 100644 --- a/src/testbed/test_testbed_underlay.conf.in +++ b/src/testbed/test_testbed_underlay.conf.in | |||
@@ -5,9 +5,9 @@ OVERLAY_TOPOLOGY = LINE | |||
5 | OPERATION_TIMEOUT = 5 s | 5 | OPERATION_TIMEOUT = 5 s |
6 | 6 | ||
7 | [testbed-underlay] | 7 | [testbed-underlay] |
8 | AUTOSTART = NO | 8 | START_ON_DEMAND = NO |
9 | DBFILE = /will/be/overwritten/by/testcase | 9 | DBFILE = /will/be/overwritten/by/testcase |
10 | FORCESTART = YES | 10 | IMMEDIATE_START = YES |
11 | 11 | ||
12 | [dv] | 12 | [dv] |
13 | AUTOSTART = NO | 13 | START_ON_DEMAND = NO |
diff --git a/src/testbed/testbed.conf.in b/src/testbed/testbed.conf.in index 86044fbfb..c1d64b324 100644 --- a/src/testbed/testbed.conf.in +++ b/src/testbed/testbed.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [testbed] | 1 | [testbed] |
2 | AUTOSTART = NO | 2 | START_ON_DEMAND = NO |
3 | @JAVAPORT@ PORT = 2101 | 3 | @JAVAPORT@ PORT = 2101 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-testbed | 5 | BINARY = gnunet-service-testbed |
@@ -90,7 +90,7 @@ SHARED_SERVICES = | |||
90 | 90 | ||
91 | 91 | ||
92 | [testbed-barrier] | 92 | [testbed-barrier] |
93 | AUTOSTART = NO | 93 | START_ON_DEMAND = NO |
94 | @UNIXONLY@ PORT = 2103 | 94 | @UNIXONLY@ PORT = 2103 |
95 | HOSTNAME = localhost | 95 | HOSTNAME = localhost |
96 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed-barrier.sock | 96 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed-barrier.sock |
@@ -101,7 +101,7 @@ UNIX_MATCH_GID = YES | |||
101 | # This section is related to configuring underlay restrictions to simulate | 101 | # This section is related to configuring underlay restrictions to simulate |
102 | # connectivity restrictions of NAT boxes | 102 | # connectivity restrictions of NAT boxes |
103 | [testbed-underlay] | 103 | [testbed-underlay] |
104 | AUTOSTART = NO | 104 | START_ON_DEMAND = NO |
105 | NOARMBIND = YES | 105 | NOARMBIND = YES |
106 | BINARY = gnunet-daemon-testbed-underlay | 106 | BINARY = gnunet-daemon-testbed-underlay |
107 | # The sqlite3 database file containing information about what underlay | 107 | # The sqlite3 database file containing information about what underlay |
@@ -109,8 +109,8 @@ BINARY = gnunet-daemon-testbed-underlay | |||
109 | # DBFILE = | 109 | # DBFILE = |
110 | 110 | ||
111 | [latency-logger] | 111 | [latency-logger] |
112 | AUTOSTART = NO | 112 | START_ON_DEMAND = NO |
113 | NOARMBIND = YES | 113 | NOARMBIND = YES |
114 | BINARY = gnunet-daemon-latency-logger | 114 | BINARY = gnunet-daemon-latency-logger |
115 | # The sqlite3 database file where the latency values are to be stored | 115 | # The sqlite3 database file where the latency values are to be stored |
116 | # DBFILE = \ No newline at end of file | 116 | # DBFILE = |
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index 51a8b979a..114055a07 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c | |||
@@ -1391,7 +1391,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
1391 | } | 1391 | } |
1392 | do | 1392 | do |
1393 | { | 1393 | { |
1394 | secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption); | 1394 | secondary_option = GNUNET_VA_ARG_ENUM (va, GNUNET_TESTBED_TopologyOption); |
1395 | 1395 | ||
1396 | switch (secondary_option) | 1396 | switch (secondary_option) |
1397 | { | 1397 | { |
@@ -1552,7 +1552,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers, | |||
1552 | tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; | 1552 | tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; |
1553 | underlay = &tc.u.underlay; | 1553 | underlay = &tc.u.underlay; |
1554 | va_start (vargs, cls); | 1554 | va_start (vargs, cls); |
1555 | topology = va_arg (vargs, enum GNUNET_TESTBED_TopologyOption); | 1555 | topology = GNUNET_VA_ARG_ENUM (vargs, GNUNET_TESTBED_TopologyOption); |
1556 | switch (topology) | 1556 | switch (topology) |
1557 | { | 1557 | { |
1558 | case GNUNET_TESTBED_TOPOLOGY_LINE: | 1558 | case GNUNET_TESTBED_TOPOLOGY_LINE: |
diff --git a/src/topology/topology.conf b/src/topology/topology.conf index 2baf7ad38..45d8dd0c7 100644 --- a/src/topology/topology.conf +++ b/src/topology/topology.conf | |||
@@ -1,5 +1,5 @@ | |||
1 | [topology] | 1 | [topology] |
2 | FORCESTART = YES | 2 | IMMEDIATE_START = YES |
3 | NOARMBIND = YES | 3 | NOARMBIND = YES |
4 | MINIMUM-FRIENDS = 0 | 4 | MINIMUM-FRIENDS = 0 |
5 | FRIENDS-ONLY = NO | 5 | FRIENDS-ONLY = NO |
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c index 4cab84066..350dc8eab 100644 --- a/src/transport/test_transport_api_manipulation_cfg.c +++ b/src/transport/test_transport_api_manipulation_cfg.c | |||
@@ -168,6 +168,7 @@ main (int argc, | |||
168 | 168 | ||
169 | ccc = &my_ccc; | 169 | ccc = &my_ccc; |
170 | sc.ccc = ccc; | 170 | sc.ccc = ccc; |
171 | start_request = GNUNET_TIME_absolute_get (); | ||
171 | if (GNUNET_OK != | 172 | if (GNUNET_OK != |
172 | GNUNET_TRANSPORT_TESTING_main (2, | 173 | GNUNET_TRANSPORT_TESTING_main (2, |
173 | &GNUNET_TRANSPORT_TESTING_connect_check, | 174 | &GNUNET_TRANSPORT_TESTING_connect_check, |
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in index 1f56a2fa7..4185acc29 100644 --- a/src/transport/transport.conf.in +++ b/src/transport/transport.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [transport] | 1 | [transport] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2091 | 3 | @JAVAPORT@PORT = 2091 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-transport | 5 | BINARY = gnunet-service-transport |
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 208cab07b..4296199db 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am | |||
@@ -199,6 +199,9 @@ gnunet_service_resolver_SOURCES = \ | |||
199 | gnunet_service_resolver_LDADD = \ | 199 | gnunet_service_resolver_LDADD = \ |
200 | libgnunetutil.la \ | 200 | libgnunetutil.la \ |
201 | $(GN_LIBINTL) | 201 | $(GN_LIBINTL) |
202 | if HAVE_GETADDRINFO_A | ||
203 | gnunet_service_resolver_LDADD += -lanl | ||
204 | endif | ||
202 | 205 | ||
203 | 206 | ||
204 | gnunet_resolver_SOURCES = \ | 207 | gnunet_resolver_SOURCES = \ |
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 85e17248b..f875d165d 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -626,6 +626,9 @@ parse_definitions (const char *constname, int force) | |||
626 | to_line = INT_MAX; | 626 | to_line = INT_MAX; |
627 | } | 627 | } |
628 | break; | 628 | break; |
629 | default: | ||
630 | fprintf(stderr, "ERROR: Unable to parse log defintion: Syntax error.\n"); | ||
631 | break; | ||
629 | } | 632 | } |
630 | start = p + 1; | 633 | start = p + 1; |
631 | state++; | 634 | state++; |
@@ -652,6 +655,7 @@ parse_definitions (const char *constname, int force) | |||
652 | start = p + 1; | 655 | start = p + 1; |
653 | break; | 656 | break; |
654 | default: | 657 | default: |
658 | fprintf(stderr, "ERROR: Unable to parse log defintion: Syntax error.\n"); | ||
655 | break; | 659 | break; |
656 | } | 660 | } |
657 | default: | 661 | default: |
diff --git a/src/util/disk.c b/src/util/disk.c index 31e8f12c6..e0227be70 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -830,6 +830,12 @@ GNUNET_DISK_directory_create_for_file (const char *filename) | |||
830 | errno = EINVAL; | 830 | errno = EINVAL; |
831 | return GNUNET_SYSERR; | 831 | return GNUNET_SYSERR; |
832 | } | 832 | } |
833 | if (0 == ACCESS (rdir, W_OK)) | ||
834 | { | ||
835 | GNUNET_free (rdir); | ||
836 | return GNUNET_OK; | ||
837 | } | ||
838 | |||
833 | len = strlen (rdir); | 839 | len = strlen (rdir); |
834 | while ((len > 0) && (rdir[len] != DIR_SEPARATOR)) | 840 | while ((len > 0) && (rdir[len] != DIR_SEPARATOR)) |
835 | len--; | 841 | len--; |
@@ -1686,16 +1692,19 @@ GNUNET_DISK_file_open (const char *fn, | |||
1686 | return NULL; | 1692 | return NULL; |
1687 | } | 1693 | } |
1688 | if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS) | 1694 | if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS) |
1689 | oflags |= (O_CREAT | O_EXCL); | 1695 | oflags |= (O_CREAT | O_EXCL); |
1690 | if (flags & GNUNET_DISK_OPEN_TRUNCATE) | 1696 | if (flags & GNUNET_DISK_OPEN_TRUNCATE) |
1691 | oflags |= O_TRUNC; | 1697 | oflags |= O_TRUNC; |
1692 | if (flags & GNUNET_DISK_OPEN_APPEND) | 1698 | if (flags & GNUNET_DISK_OPEN_APPEND) |
1693 | oflags |= O_APPEND; | 1699 | oflags |= O_APPEND; |
1694 | if (flags & GNUNET_DISK_OPEN_CREATE) | 1700 | if(GNUNET_NO == GNUNET_DISK_file_test(fn)) |
1695 | { | 1701 | { |
1696 | (void) GNUNET_DISK_directory_create_for_file (expfn); | 1702 | if (flags & GNUNET_DISK_OPEN_CREATE ) |
1697 | oflags |= O_CREAT; | 1703 | { |
1698 | mode = translate_unix_perms (perm); | 1704 | (void) GNUNET_DISK_directory_create_for_file (expfn); |
1705 | oflags |= O_CREAT; | ||
1706 | mode = translate_unix_perms (perm); | ||
1707 | } | ||
1699 | } | 1708 | } |
1700 | 1709 | ||
1701 | fd = open (expfn, oflags | 1710 | fd = open (expfn, oflags |
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index c55b22fb6..32cce65dd 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c | |||
@@ -748,6 +748,13 @@ set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
748 | unsigned int *val = scls; | 748 | unsigned int *val = scls; |
749 | 749 | ||
750 | (void) ctx; | 750 | (void) ctx; |
751 | if('-' == *value) | ||
752 | { | ||
753 | FPRINTF (stderr, | ||
754 | _("Your input for the '%s' option has to be a non negative number \n"), | ||
755 | option); | ||
756 | return GNUNET_SYSERR; | ||
757 | } | ||
751 | if (1 != SSCANF (value, | 758 | if (1 != SSCANF (value, |
752 | "%u", | 759 | "%u", |
753 | val)) | 760 | val)) |
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index d26ec659f..d90d8ec10 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c | |||
@@ -84,6 +84,16 @@ static struct IPCache *cache_head; | |||
84 | */ | 84 | */ |
85 | static struct IPCache *cache_tail; | 85 | static struct IPCache *cache_tail; |
86 | 86 | ||
87 | /** | ||
88 | * Pipe for asynchronously notifying about resolve result | ||
89 | */ | ||
90 | static struct GNUNET_DISK_PipeHandle *resolve_result_pipe; | ||
91 | |||
92 | /** | ||
93 | * Task for reading from resolve_result_pipe | ||
94 | */ | ||
95 | static struct GNUNET_SCHEDULER_Task *resolve_result_pipe_task; | ||
96 | |||
87 | 97 | ||
88 | #if HAVE_GETNAMEINFO | 98 | #if HAVE_GETNAMEINFO |
89 | /** | 99 | /** |
@@ -223,14 +233,15 @@ notify_service_client_done (void *cls) | |||
223 | static void | 233 | static void |
224 | get_ip_as_string (struct GNUNET_SERVICE_Client *client, | 234 | get_ip_as_string (struct GNUNET_SERVICE_Client *client, |
225 | int af, | 235 | int af, |
226 | const void *ip) | 236 | const void *ip, |
237 | uint32_t request_id) | ||
227 | { | 238 | { |
228 | struct IPCache *pos; | 239 | struct IPCache *pos; |
229 | struct IPCache *next; | 240 | struct IPCache *next; |
230 | struct GNUNET_TIME_Absolute now; | 241 | struct GNUNET_TIME_Absolute now; |
231 | struct GNUNET_MQ_Envelope *env; | 242 | struct GNUNET_MQ_Envelope *env; |
232 | struct GNUNET_MQ_Handle *mq; | 243 | struct GNUNET_MQ_Handle *mq; |
233 | struct GNUNET_MessageHeader *msg; | 244 | struct GNUNET_RESOLVER_ResponseMessage *msg; |
234 | size_t ip_len; | 245 | size_t ip_len; |
235 | struct in6_addr ix; | 246 | struct in6_addr ix; |
236 | size_t alen; | 247 | size_t alen; |
@@ -304,13 +315,16 @@ get_ip_as_string (struct GNUNET_SERVICE_Client *client, | |||
304 | env = GNUNET_MQ_msg_extra (msg, | 315 | env = GNUNET_MQ_msg_extra (msg, |
305 | alen, | 316 | alen, |
306 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 317 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
318 | msg->id = request_id; | ||
307 | GNUNET_memcpy (&msg[1], | 319 | GNUNET_memcpy (&msg[1], |
308 | pos->addr, | 320 | pos->addr, |
309 | alen); | 321 | alen); |
310 | GNUNET_MQ_send (mq, | 322 | GNUNET_MQ_send (mq, |
311 | env); | 323 | env); |
324 | // send end message | ||
312 | env = GNUNET_MQ_msg (msg, | 325 | env = GNUNET_MQ_msg (msg, |
313 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 326 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
327 | msg->id = request_id; | ||
314 | GNUNET_MQ_notify_sent (env, | 328 | GNUNET_MQ_notify_sent (env, |
315 | ¬ify_service_client_done, | 329 | ¬ify_service_client_done, |
316 | client); | 330 | client); |
@@ -319,17 +333,152 @@ get_ip_as_string (struct GNUNET_SERVICE_Client *client, | |||
319 | } | 333 | } |
320 | 334 | ||
321 | 335 | ||
322 | #if HAVE_GETADDRINFO | 336 | #if HAVE_GETADDRINFO_A |
337 | struct AsyncCls | ||
338 | { | ||
339 | struct gaicb *host; | ||
340 | struct sigevent *sig; | ||
341 | struct GNUNET_MQ_Handle *mq; | ||
342 | uint32_t request_id; | ||
343 | }; | ||
344 | |||
345 | |||
346 | static void | ||
347 | resolve_result_pipe_cb (void *cls) | ||
348 | { | ||
349 | struct AsyncCls *async_cls; | ||
350 | struct gaicb *host; | ||
351 | struct GNUNET_RESOLVER_ResponseMessage *msg; | ||
352 | struct GNUNET_MQ_Envelope *env; | ||
353 | |||
354 | GNUNET_DISK_file_read (GNUNET_DISK_pipe_handle (resolve_result_pipe, | ||
355 | GNUNET_DISK_PIPE_END_READ), | ||
356 | &async_cls, | ||
357 | sizeof (struct AsyncCls *)); | ||
358 | resolve_result_pipe_task = | ||
359 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | ||
360 | GNUNET_DISK_pipe_handle (resolve_result_pipe, | ||
361 | GNUNET_DISK_PIPE_END_READ), | ||
362 | &resolve_result_pipe_cb, | ||
363 | NULL); | ||
364 | host = async_cls->host; | ||
365 | for (struct addrinfo *pos = host->ar_result; pos != NULL; pos = pos->ai_next) | ||
366 | { | ||
367 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
368 | "Lookup result for hostname %s: %s (request ID %u)\n", | ||
369 | host->ar_name, | ||
370 | GNUNET_a2s (pos->ai_addr, pos->ai_addrlen), | ||
371 | async_cls->request_id); | ||
372 | switch (pos->ai_family) | ||
373 | { | ||
374 | case AF_INET: | ||
375 | env = GNUNET_MQ_msg_extra (msg, | ||
376 | sizeof (struct in_addr), | ||
377 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | ||
378 | msg->id = async_cls->request_id; | ||
379 | GNUNET_memcpy (&msg[1], | ||
380 | &((struct sockaddr_in*) pos->ai_addr)->sin_addr, | ||
381 | sizeof (struct in_addr)); | ||
382 | GNUNET_MQ_send (async_cls->mq, | ||
383 | env); | ||
384 | break; | ||
385 | case AF_INET6: | ||
386 | env = GNUNET_MQ_msg_extra (msg, | ||
387 | sizeof (struct in6_addr), | ||
388 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | ||
389 | msg->id = async_cls->request_id; | ||
390 | GNUNET_memcpy (&msg[1], | ||
391 | &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr, | ||
392 | sizeof (struct in6_addr)); | ||
393 | GNUNET_MQ_send (async_cls->mq, | ||
394 | env); | ||
395 | break; | ||
396 | default: | ||
397 | /* unsupported, skip */ | ||
398 | break; | ||
399 | } | ||
400 | } | ||
401 | // send end message | ||
402 | env = GNUNET_MQ_msg (msg, | ||
403 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | ||
404 | msg->id = async_cls->request_id; | ||
405 | GNUNET_MQ_send (async_cls->mq, | ||
406 | env); | ||
407 | freeaddrinfo (host->ar_result); | ||
408 | GNUNET_free ((struct gaicb *)host->ar_request); // free hints | ||
409 | GNUNET_free (host); | ||
410 | GNUNET_free (async_cls->sig); | ||
411 | GNUNET_free (async_cls); | ||
412 | } | ||
413 | |||
414 | |||
415 | static void | ||
416 | handle_async_result (union sigval val) | ||
417 | { | ||
418 | GNUNET_DISK_file_write (GNUNET_DISK_pipe_handle (resolve_result_pipe, | ||
419 | GNUNET_DISK_PIPE_END_WRITE), | ||
420 | &val.sival_ptr, | ||
421 | sizeof (val.sival_ptr)); | ||
422 | } | ||
423 | |||
424 | |||
425 | static int | ||
426 | getaddrinfo_a_resolve (struct GNUNET_MQ_Handle *mq, | ||
427 | const char *hostname, | ||
428 | int af, | ||
429 | uint32_t request_id) | ||
430 | { | ||
431 | int ret; | ||
432 | struct gaicb *host; | ||
433 | struct addrinfo *hints; | ||
434 | struct sigevent *sig; | ||
435 | struct AsyncCls *async_cls; | ||
436 | |||
437 | host = GNUNET_new (struct gaicb); | ||
438 | hints = GNUNET_new (struct addrinfo); | ||
439 | sig = GNUNET_new (struct sigevent); | ||
440 | async_cls = GNUNET_new (struct AsyncCls); | ||
441 | memset (hints, | ||
442 | 0, | ||
443 | sizeof (struct addrinfo)); | ||
444 | memset (sig, | ||
445 | 0, | ||
446 | sizeof (struct sigevent)); | ||
447 | hints->ai_family = af; | ||
448 | hints->ai_socktype = SOCK_STREAM; /* go for TCP */ | ||
449 | host->ar_name = hostname; | ||
450 | host->ar_service = NULL; | ||
451 | host->ar_request = hints; | ||
452 | host->ar_result = NULL; | ||
453 | sig->sigev_notify = SIGEV_THREAD; | ||
454 | sig->sigev_value.sival_ptr = async_cls; | ||
455 | sig->sigev_notify_function = &handle_async_result; | ||
456 | async_cls->host = host; | ||
457 | async_cls->sig = sig; | ||
458 | async_cls->mq = mq; | ||
459 | async_cls->request_id = request_id; | ||
460 | ret = getaddrinfo_a (GAI_NOWAIT, | ||
461 | &host, | ||
462 | 1, | ||
463 | sig); | ||
464 | if (0 != ret) | ||
465 | return GNUNET_SYSERR; | ||
466 | return GNUNET_OK; | ||
467 | } | ||
468 | |||
469 | |||
470 | #elif HAVE_GETADDRINFO | ||
323 | static int | 471 | static int |
324 | getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, | 472 | getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, |
325 | const char *hostname, | 473 | const char *hostname, |
326 | int af) | 474 | int af, |
475 | uint32_t request_id) | ||
327 | { | 476 | { |
328 | int s; | 477 | int s; |
329 | struct addrinfo hints; | 478 | struct addrinfo hints; |
330 | struct addrinfo *result; | 479 | struct addrinfo *result; |
331 | struct addrinfo *pos; | 480 | struct addrinfo *pos; |
332 | struct GNUNET_MessageHeader *msg; | 481 | struct GNUNET_RESOLVER_ResponseMessage *msg; |
333 | struct GNUNET_MQ_Envelope *env; | 482 | struct GNUNET_MQ_Envelope *env; |
334 | 483 | ||
335 | #ifdef WINDOWS | 484 | #ifdef WINDOWS |
@@ -340,10 +489,12 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, | |||
340 | int ret2; | 489 | int ret2; |
341 | ret1 = getaddrinfo_resolve (mq, | 490 | ret1 = getaddrinfo_resolve (mq, |
342 | hostname, | 491 | hostname, |
343 | AF_INET); | 492 | AF_INET, |
493 | request_id); | ||
344 | ret2 = getaddrinfo_resolve (mq, | 494 | ret2 = getaddrinfo_resolve (mq, |
345 | hostname, | 495 | hostname, |
346 | AF_INET6); | 496 | AF_INET6, |
497 | request_id); | ||
347 | if ( (ret1 == GNUNET_OK) || | 498 | if ( (ret1 == GNUNET_OK) || |
348 | (ret2 == GNUNET_OK) ) | 499 | (ret2 == GNUNET_OK) ) |
349 | return GNUNET_OK; | 500 | return GNUNET_OK; |
@@ -389,6 +540,7 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, | |||
389 | env = GNUNET_MQ_msg_extra (msg, | 540 | env = GNUNET_MQ_msg_extra (msg, |
390 | sizeof (struct in_addr), | 541 | sizeof (struct in_addr), |
391 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 542 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
543 | msg->id = request_id; | ||
392 | GNUNET_memcpy (&msg[1], | 544 | GNUNET_memcpy (&msg[1], |
393 | &((struct sockaddr_in*) pos->ai_addr)->sin_addr, | 545 | &((struct sockaddr_in*) pos->ai_addr)->sin_addr, |
394 | sizeof (struct in_addr)); | 546 | sizeof (struct in_addr)); |
@@ -399,6 +551,7 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, | |||
399 | env = GNUNET_MQ_msg_extra (msg, | 551 | env = GNUNET_MQ_msg_extra (msg, |
400 | sizeof (struct in6_addr), | 552 | sizeof (struct in6_addr), |
401 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 553 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
554 | msg->id = request_id; | ||
402 | GNUNET_memcpy (&msg[1], | 555 | GNUNET_memcpy (&msg[1], |
403 | &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr, | 556 | &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr, |
404 | sizeof (struct in6_addr)); | 557 | sizeof (struct in6_addr)); |
@@ -421,13 +574,14 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, | |||
421 | static int | 574 | static int |
422 | gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, | 575 | gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, |
423 | const char *hostname, | 576 | const char *hostname, |
424 | int af) | 577 | int af, |
578 | uint32_t request_id) | ||
425 | { | 579 | { |
426 | struct hostent *hp; | 580 | struct hostent *hp; |
427 | int ret1; | 581 | int ret1; |
428 | int ret2; | 582 | int ret2; |
429 | struct GNUNET_MQ_Envelope *env; | 583 | struct GNUNET_MQ_Envelope *env; |
430 | struct GNUNET_MessageHeader *msg; | 584 | struct GNUNET_RESOLVER_ResponseMessage *msg; |
431 | 585 | ||
432 | #ifdef WINDOWS | 586 | #ifdef WINDOWS |
433 | /* gethostbyname2() in plibc is a compat dummy that calls gethostbyname(). */ | 587 | /* gethostbyname2() in plibc is a compat dummy that calls gethostbyname(). */ |
@@ -438,10 +592,12 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, | |||
438 | { | 592 | { |
439 | ret1 = gethostbyname2_resolve (mq, | 593 | ret1 = gethostbyname2_resolve (mq, |
440 | hostname, | 594 | hostname, |
441 | AF_INET); | 595 | AF_INET, |
596 | request_id); | ||
442 | ret2 = gethostbyname2_resolve (mq, | 597 | ret2 = gethostbyname2_resolve (mq, |
443 | hostname, | 598 | hostname, |
444 | AF_INET6); | 599 | AF_INET6, |
600 | request_id); | ||
445 | if ( (ret1 == GNUNET_OK) || | 601 | if ( (ret1 == GNUNET_OK) || |
446 | (ret2 == GNUNET_OK) ) | 602 | (ret2 == GNUNET_OK) ) |
447 | return GNUNET_OK; | 603 | return GNUNET_OK; |
@@ -468,6 +624,7 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, | |||
468 | env = GNUNET_MQ_msg_extra (msg, | 624 | env = GNUNET_MQ_msg_extra (msg, |
469 | hp->h_length, | 625 | hp->h_length, |
470 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 626 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
627 | msg->id = request_id; | ||
471 | GNUNET_memcpy (&msg[1], | 628 | GNUNET_memcpy (&msg[1], |
472 | hp->h_addr_list[0], | 629 | hp->h_addr_list[0], |
473 | hp->h_length); | 630 | hp->h_length); |
@@ -479,6 +636,7 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, | |||
479 | env = GNUNET_MQ_msg_extra (msg, | 636 | env = GNUNET_MQ_msg_extra (msg, |
480 | hp->h_length, | 637 | hp->h_length, |
481 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 638 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
639 | msg->id = request_id; | ||
482 | GNUNET_memcpy (&msg[1], | 640 | GNUNET_memcpy (&msg[1], |
483 | hp->h_addr_list[0], | 641 | hp->h_addr_list[0], |
484 | hp->h_length); | 642 | hp->h_length); |
@@ -497,10 +655,11 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, | |||
497 | 655 | ||
498 | static int | 656 | static int |
499 | gethostbyname_resolve (struct GNUNET_MQ_Handle *mq, | 657 | gethostbyname_resolve (struct GNUNET_MQ_Handle *mq, |
500 | const char *hostname) | 658 | const char *hostname, |
659 | uint32_t request_id) | ||
501 | { | 660 | { |
502 | struct hostent *hp; | 661 | struct hostent *hp; |
503 | struct GNUNET_MessageHeader *msg; | 662 | struct GNUNET_RESOLVER_ResponseMessage *msg; |
504 | struct GNUNET_MQ_Envelope *env; | 663 | struct GNUNET_MQ_Envelope *env; |
505 | 664 | ||
506 | hp = GETHOSTBYNAME (hostname); | 665 | hp = GETHOSTBYNAME (hostname); |
@@ -521,6 +680,7 @@ gethostbyname_resolve (struct GNUNET_MQ_Handle *mq, | |||
521 | env = GNUNET_MQ_msg_extra (msg, | 680 | env = GNUNET_MQ_msg_extra (msg, |
522 | hp->h_length, | 681 | hp->h_length, |
523 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 682 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
683 | msg->id = request_id; | ||
524 | GNUNET_memcpy (&msg[1], | 684 | GNUNET_memcpy (&msg[1], |
525 | hp->h_addr_list[0], | 685 | hp->h_addr_list[0], |
526 | hp->h_length); | 686 | hp->h_length); |
@@ -541,34 +701,42 @@ gethostbyname_resolve (struct GNUNET_MQ_Handle *mq, | |||
541 | static void | 701 | static void |
542 | get_ip_from_hostname (struct GNUNET_SERVICE_Client *client, | 702 | get_ip_from_hostname (struct GNUNET_SERVICE_Client *client, |
543 | const char *hostname, | 703 | const char *hostname, |
544 | int af) | 704 | int af, |
705 | uint32_t request_id) | ||
545 | { | 706 | { |
546 | int ret; | ||
547 | struct GNUNET_MQ_Handle *mq; | ||
548 | struct GNUNET_MQ_Envelope *env; | 707 | struct GNUNET_MQ_Envelope *env; |
549 | struct GNUNET_MessageHeader *msg; | 708 | struct GNUNET_RESOLVER_ResponseMessage *msg; |
709 | struct GNUNET_MQ_Handle *mq; | ||
550 | 710 | ||
551 | mq = GNUNET_SERVICE_client_get_mq (client); | 711 | mq = GNUNET_SERVICE_client_get_mq (client); |
552 | ret = GNUNET_NO; | 712 | #if HAVE_GETADDRINFO_A |
553 | #if HAVE_GETADDRINFO | 713 | getaddrinfo_a_resolve (mq, |
554 | if (ret == GNUNET_NO) | 714 | hostname, |
555 | ret = getaddrinfo_resolve (mq, | 715 | af, |
556 | hostname, | 716 | request_id); |
557 | af); | 717 | GNUNET_SERVICE_client_continue (client); |
718 | return; | ||
719 | #elif HAVE_GETADDRINFO | ||
720 | getaddrinfo_resolve (mq, | ||
721 | hostname, | ||
722 | af, | ||
723 | request_id); | ||
558 | #elif HAVE_GETHOSTBYNAME2 | 724 | #elif HAVE_GETHOSTBYNAME2 |
559 | if (ret == GNUNET_NO) | 725 | gethostbyname2_resolve (mq, |
560 | ret = gethostbyname2_resolve (mq, | 726 | hostname, |
561 | hostname, | 727 | af, |
562 | af); | 728 | request_id); |
563 | #elif HAVE_GETHOSTBYNAME | 729 | #elif HAVE_GETHOSTBYNAME |
564 | if ( (ret == GNUNET_NO) && | 730 | if ( ( (af == AF_UNSPEC) || |
565 | ( (af == AF_UNSPEC) || | ||
566 | (af == PF_INET) ) ) | 731 | (af == PF_INET) ) ) |
567 | gethostbyname_resolve (mq, | 732 | gethostbyname_resolve (mq, |
568 | hostname); | 733 | hostname, |
734 | request_id); | ||
569 | #endif | 735 | #endif |
736 | // send end message | ||
570 | env = GNUNET_MQ_msg (msg, | 737 | env = GNUNET_MQ_msg (msg, |
571 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); | 738 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); |
739 | msg->id = request_id; | ||
572 | GNUNET_MQ_notify_sent (env, | 740 | GNUNET_MQ_notify_sent (env, |
573 | ¬ify_service_client_done, | 741 | ¬ify_service_client_done, |
574 | client); | 742 | client); |
@@ -647,21 +815,21 @@ handle_get (void *cls, | |||
647 | const void *ip; | 815 | const void *ip; |
648 | int direction; | 816 | int direction; |
649 | int af; | 817 | int af; |
818 | uint32_t id; | ||
650 | 819 | ||
651 | direction = ntohl (msg->direction); | 820 | direction = ntohl (msg->direction); |
652 | af = ntohl (msg->af); | 821 | af = ntohl (msg->af); |
822 | id = ntohl (msg->id); | ||
653 | if (GNUNET_NO == direction) | 823 | if (GNUNET_NO == direction) |
654 | { | 824 | { |
655 | /* IP from hostname */ | 825 | /* IP from hostname */ |
656 | const char *hostname; | 826 | const char *hostname; |
657 | 827 | ||
658 | hostname = (const char *) &msg[1]; | 828 | hostname = (const char *) &msg[1]; |
659 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
660 | "Resolver asked to look up `%s'.\n", | ||
661 | hostname); | ||
662 | get_ip_from_hostname (client, | 829 | get_ip_from_hostname (client, |
663 | hostname, | 830 | hostname, |
664 | af); | 831 | af, |
832 | id); | ||
665 | return; | 833 | return; |
666 | } | 834 | } |
667 | ip = &msg[1]; | 835 | ip = &msg[1]; |
@@ -671,16 +839,18 @@ handle_get (void *cls, | |||
671 | char buf[INET6_ADDRSTRLEN]; | 839 | char buf[INET6_ADDRSTRLEN]; |
672 | 840 | ||
673 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 841 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
674 | "Resolver asked to look up IP address `%s'.\n", | 842 | "Resolver asked to look up IP address `%s (request ID %u)'.\n", |
675 | inet_ntop (af, | 843 | inet_ntop (af, |
676 | ip, | 844 | ip, |
677 | buf, | 845 | buf, |
678 | sizeof (buf))); | 846 | sizeof (buf)), |
847 | id); | ||
679 | } | 848 | } |
680 | #endif | 849 | #endif |
681 | get_ip_as_string (client, | 850 | get_ip_as_string (client, |
682 | af, | 851 | af, |
683 | ip); | 852 | ip, |
853 | id); | ||
684 | } | 854 | } |
685 | 855 | ||
686 | 856 | ||
@@ -700,6 +870,19 @@ connect_cb (void *cls, | |||
700 | (void) cls; | 870 | (void) cls; |
701 | (void) mq; | 871 | (void) mq; |
702 | 872 | ||
873 | #if HAVE_GETADDRINFO_A | ||
874 | resolve_result_pipe = GNUNET_DISK_pipe (GNUNET_NO, | ||
875 | GNUNET_NO, | ||
876 | GNUNET_NO, | ||
877 | GNUNET_NO); | ||
878 | GNUNET_assert (NULL != resolve_result_pipe); | ||
879 | resolve_result_pipe_task = | ||
880 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | ||
881 | GNUNET_DISK_pipe_handle (resolve_result_pipe, | ||
882 | GNUNET_DISK_PIPE_END_READ), | ||
883 | &resolve_result_pipe_cb, | ||
884 | NULL); | ||
885 | #endif | ||
703 | return c; | 886 | return c; |
704 | } | 887 | } |
705 | 888 | ||
@@ -718,6 +901,18 @@ disconnect_cb (void *cls, | |||
718 | { | 901 | { |
719 | (void) cls; | 902 | (void) cls; |
720 | 903 | ||
904 | #if HAVE_GETADDRINFO_A | ||
905 | if (NULL != resolve_result_pipe_task) | ||
906 | { | ||
907 | GNUNET_SCHEDULER_cancel (resolve_result_pipe_task); | ||
908 | resolve_result_pipe_task = NULL; | ||
909 | } | ||
910 | if (NULL != resolve_result_pipe) | ||
911 | { | ||
912 | GNUNET_DISK_pipe_close (resolve_result_pipe); | ||
913 | resolve_result_pipe = NULL; | ||
914 | } | ||
915 | #endif | ||
721 | GNUNET_assert (c == internal_cls); | 916 | GNUNET_assert (c == internal_cls); |
722 | } | 917 | } |
723 | 918 | ||
diff --git a/src/util/resolver.conf.in b/src/util/resolver.conf.in index 9c5df32bc..6e2b9a869 100644 --- a/src/util/resolver.conf.in +++ b/src/util/resolver.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [resolver] | 1 | [resolver] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @JAVAPORT@PORT = 2089 | 3 | @JAVAPORT@PORT = 2089 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-resolver | 5 | BINARY = gnunet-service-resolver |
diff --git a/src/util/resolver.h b/src/util/resolver.h index 0b137f085..a0f105afa 100644 --- a/src/util/resolver.h +++ b/src/util/resolver.h | |||
@@ -56,10 +56,37 @@ struct GNUNET_RESOLVER_GetMessage | |||
56 | */ | 56 | */ |
57 | int32_t af GNUNET_PACKED; | 57 | int32_t af GNUNET_PACKED; |
58 | 58 | ||
59 | /** | ||
60 | * identifies the request and is contained in the response message. The | ||
61 | * client has to match response to request by this identifier. | ||
62 | */ | ||
63 | uint32_t id GNUNET_PACKED; | ||
64 | |||
59 | /* followed by 0-terminated string for A/AAAA-lookup or | 65 | /* followed by 0-terminated string for A/AAAA-lookup or |
60 | by 'struct in_addr' / 'struct in6_addr' for reverse lookup */ | 66 | by 'struct in_addr' / 'struct in6_addr' for reverse lookup */ |
61 | 67 | ||
62 | }; | 68 | }; |
69 | |||
70 | |||
71 | struct GNUNET_RESOLVER_ResponseMessage | ||
72 | { | ||
73 | /** | ||
74 | * Type: GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE | ||
75 | */ | ||
76 | struct GNUNET_MessageHeader header; | ||
77 | |||
78 | /** | ||
79 | * identifies the request this message responds to. The client | ||
80 | * has to match response to request by this identifier. | ||
81 | */ | ||
82 | uint32_t id GNUNET_PACKED; | ||
83 | |||
84 | /* followed by 0-terminated string for response to a reverse lookup | ||
85 | * or by 'struct in_addr' / 'struct in6_addr' for response to | ||
86 | * A/AAAA-lookup | ||
87 | */ | ||
88 | }; | ||
89 | |||
63 | GNUNET_NETWORK_STRUCT_END | 90 | GNUNET_NETWORK_STRUCT_END |
64 | 91 | ||
65 | #endif | 92 | #endif |
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index b2e6a4986..b94819f06 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -69,6 +69,11 @@ static struct GNUNET_RESOLVER_RequestHandle *req_head; | |||
69 | static struct GNUNET_RESOLVER_RequestHandle *req_tail; | 69 | static struct GNUNET_RESOLVER_RequestHandle *req_tail; |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * ID of the last request we sent to the service | ||
73 | */ | ||
74 | static uint32_t last_request_id; | ||
75 | |||
76 | /** | ||
72 | * How long should we wait to reconnect? | 77 | * How long should we wait to reconnect? |
73 | */ | 78 | */ |
74 | static struct GNUNET_TIME_Relative backoff; | 79 | static struct GNUNET_TIME_Relative backoff; |
@@ -137,6 +142,11 @@ struct GNUNET_RESOLVER_RequestHandle | |||
137 | int af; | 142 | int af; |
138 | 143 | ||
139 | /** | 144 | /** |
145 | * Identifies the request. The response will contain this id. | ||
146 | */ | ||
147 | uint32_t id; | ||
148 | |||
149 | /** | ||
140 | * Has this request been transmitted to the service? | 150 | * Has this request been transmitted to the service? |
141 | * #GNUNET_YES if transmitted | 151 | * #GNUNET_YES if transmitted |
142 | * #GNUNET_YES if not transmitted | 152 | * #GNUNET_YES if not transmitted |
@@ -180,6 +190,11 @@ check_config () | |||
180 | struct sockaddr_in v4; | 190 | struct sockaddr_in v4; |
181 | struct sockaddr_in6 v6; | 191 | struct sockaddr_in6 v6; |
182 | 192 | ||
193 | if (GNUNET_OK == | ||
194 | GNUNET_CONFIGURATION_have_value (resolver_cfg, | ||
195 | "resolver", | ||
196 | "UNIXPATH")) | ||
197 | return GNUNET_OK; | ||
183 | memset (&v4, 0, sizeof (v4)); | 198 | memset (&v4, 0, sizeof (v4)); |
184 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); | 199 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); |
185 | v4.sin_family = AF_INET; | 200 | v4.sin_family = AF_INET; |
@@ -430,11 +445,13 @@ process_requests () | |||
430 | GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST); | 445 | GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST); |
431 | msg->direction = htonl (rh->direction); | 446 | msg->direction = htonl (rh->direction); |
432 | msg->af = htonl (rh->af); | 447 | msg->af = htonl (rh->af); |
448 | msg->id = htonl (rh->id); | ||
433 | GNUNET_memcpy (&msg[1], | 449 | GNUNET_memcpy (&msg[1], |
434 | &rh[1], | 450 | &rh[1], |
435 | rh->data_len); | 451 | rh->data_len); |
436 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 452 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
437 | "Transmitting DNS resolution request to DNS service\n"); | 453 | "Transmitting DNS resolution request (ID %u) to DNS service\n", |
454 | rh->id); | ||
438 | GNUNET_MQ_send (mq, | 455 | GNUNET_MQ_send (mq, |
439 | env); | 456 | env); |
440 | rh->was_transmitted = GNUNET_YES; | 457 | rh->was_transmitted = GNUNET_YES; |
@@ -449,7 +466,7 @@ process_requests () | |||
449 | */ | 466 | */ |
450 | static int | 467 | static int |
451 | check_response (void *cls, | 468 | check_response (void *cls, |
452 | const struct GNUNET_MessageHeader *msg) | 469 | const struct GNUNET_RESOLVER_ResponseMessage *msg) |
453 | { | 470 | { |
454 | (void) cls; | 471 | (void) cls; |
455 | (void) msg; | 472 | (void) msg; |
@@ -469,11 +486,18 @@ check_response (void *cls, | |||
469 | */ | 486 | */ |
470 | static void | 487 | static void |
471 | handle_response (void *cls, | 488 | handle_response (void *cls, |
472 | const struct GNUNET_MessageHeader *msg) | 489 | const struct GNUNET_RESOLVER_ResponseMessage *msg) |
473 | { | 490 | { |
474 | struct GNUNET_RESOLVER_RequestHandle *rh = req_head; | 491 | struct GNUNET_RESOLVER_RequestHandle *rh = req_head; |
475 | uint16_t size; | 492 | uint16_t size; |
476 | char *nret; | 493 | char *nret; |
494 | uint32_t request_id = msg->id; | ||
495 | |||
496 | for (; rh != NULL; rh = rh->next) | ||
497 | { | ||
498 | if (rh->id == request_id) | ||
499 | break; | ||
500 | } | ||
477 | 501 | ||
478 | (void) cls; | 502 | (void) cls; |
479 | if (NULL == rh) | 503 | if (NULL == rh) |
@@ -485,8 +509,8 @@ handle_response (void *cls, | |||
485 | reconnect (); | 509 | reconnect (); |
486 | return; | 510 | return; |
487 | } | 511 | } |
488 | size = ntohs (msg->size); | 512 | size = ntohs (msg->header.size); |
489 | if (size == sizeof (struct GNUNET_MessageHeader)) | 513 | if (size == sizeof (struct GNUNET_RESOLVER_ResponseMessage)) |
490 | { | 514 | { |
491 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 515 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
492 | "Received empty response from DNS service\n"); | 516 | "Received empty response from DNS service\n"); |
@@ -527,7 +551,7 @@ handle_response (void *cls, | |||
527 | const char *hostname; | 551 | const char *hostname; |
528 | 552 | ||
529 | hostname = (const char *) &msg[1]; | 553 | hostname = (const char *) &msg[1]; |
530 | if (hostname[size - sizeof (struct GNUNET_MessageHeader) - 1] != '\0') | 554 | if (hostname[size - sizeof (struct GNUNET_RESOLVER_ResponseMessage) - 1] != '\0') |
531 | { | 555 | { |
532 | GNUNET_break (0); | 556 | GNUNET_break (0); |
533 | if (GNUNET_SYSERR != rh->was_transmitted) | 557 | if (GNUNET_SYSERR != rh->was_transmitted) |
@@ -561,7 +585,7 @@ handle_response (void *cls, | |||
561 | size_t ip_len; | 585 | size_t ip_len; |
562 | 586 | ||
563 | ip = &msg[1]; | 587 | ip = &msg[1]; |
564 | ip_len = size - sizeof (struct GNUNET_MessageHeader); | 588 | ip_len = size - sizeof (struct GNUNET_RESOLVER_ResponseMessage); |
565 | if (ip_len == sizeof (struct in_addr)) | 589 | if (ip_len == sizeof (struct in_addr)) |
566 | { | 590 | { |
567 | memset (&v4, 0, sizeof (v4)); | 591 | memset (&v4, 0, sizeof (v4)); |
@@ -758,7 +782,7 @@ reconnect_task (void *cls) | |||
758 | struct GNUNET_MQ_MessageHandler handlers[] = { | 782 | struct GNUNET_MQ_MessageHandler handlers[] = { |
759 | GNUNET_MQ_hd_var_size (response, | 783 | GNUNET_MQ_hd_var_size (response, |
760 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE, | 784 | GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE, |
761 | struct GNUNET_MessageHeader, | 785 | struct GNUNET_RESOLVER_ResponseMessage, |
762 | NULL), | 786 | NULL), |
763 | GNUNET_MQ_handler_end () | 787 | GNUNET_MQ_handler_end () |
764 | }; | 788 | }; |
@@ -921,6 +945,7 @@ GNUNET_RESOLVER_ip_get (const char *hostname, | |||
921 | hostname); | 945 | hostname); |
922 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen); | 946 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen); |
923 | rh->af = af; | 947 | rh->af = af; |
948 | rh->id = ++last_request_id; | ||
924 | rh->addr_callback = callback; | 949 | rh->addr_callback = callback; |
925 | rh->cls = callback_cls; | 950 | rh->cls = callback_cls; |
926 | GNUNET_memcpy (&rh[1], | 951 | GNUNET_memcpy (&rh[1], |
@@ -1067,6 +1092,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, | |||
1067 | rh->name_callback = callback; | 1092 | rh->name_callback = callback; |
1068 | rh->cls = cls; | 1093 | rh->cls = cls; |
1069 | rh->af = sa->sa_family; | 1094 | rh->af = sa->sa_family; |
1095 | rh->id = ++last_request_id; | ||
1070 | rh->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 1096 | rh->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
1071 | GNUNET_memcpy (&rh[1], | 1097 | GNUNET_memcpy (&rh[1], |
1072 | ip, | 1098 | ip, |
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index c89fad865..5a8f95093 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -258,6 +258,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
258 | /* Resolve the same using GNUNET */ | 258 | /* Resolve the same using GNUNET */ |
259 | GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, | 259 | GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, |
260 | &check_rootserver_ip, cls); | 260 | &check_rootserver_ip, cls); |
261 | GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, | ||
262 | &check_rootserver_ip, cls); | ||
261 | 263 | ||
262 | /* | 264 | /* |
263 | * Success: forward lookups work as expected | 265 | * Success: forward lookups work as expected |
diff --git a/src/util/util.conf b/src/util/util.conf index f2e5bee28..dbc2b2e0d 100644 --- a/src/util/util.conf +++ b/src/util/util.conf | |||
@@ -25,7 +25,7 @@ GNUNET_CACHE_HOME = ${XDG_CACHE_HOME:-$GNUNET_HOME/.cache}/gnunet/ | |||
25 | 25 | ||
26 | # Runtime data (i.e UNIX domain sockets, locks, always lost on system boot) | 26 | # Runtime data (i.e UNIX domain sockets, locks, always lost on system boot) |
27 | # This is the variable for system-wide services; use GNUNET_USER_RUNTIME_DIR | 27 | # This is the variable for system-wide services; use GNUNET_USER_RUNTIME_DIR |
28 | # for per-user services (where USER_SERVICE=YES is set) | 28 | # for per-user services (where RUN_PER_USER=YES is set) |
29 | # Note that the 'gnunet'/system user must have $TMPDIR/$TMP set to | 29 | # Note that the 'gnunet'/system user must have $TMPDIR/$TMP set to |
30 | # exactly the same values as 'normal' users, otherwise this will fail. | 30 | # exactly the same values as 'normal' users, otherwise this will fail. |
31 | # If $TMPDIR or $TMP are set to different directories for different | 31 | # If $TMPDIR or $TMP are set to different directories for different |
diff --git a/src/vpn/vpn.conf.in b/src/vpn/vpn.conf.in index 585131554..c0f4c59ed 100644 --- a/src/vpn/vpn.conf.in +++ b/src/vpn/vpn.conf.in | |||
@@ -1,5 +1,5 @@ | |||
1 | [vpn] | 1 | [vpn] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | @UNIXONLY@ PORT = 2105 | 3 | @UNIXONLY@ PORT = 2105 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-vpn | 5 | BINARY = gnunet-service-vpn |
diff --git a/src/zonemaster/zonemaster.conf.in b/src/zonemaster/zonemaster.conf.in index 6179b87be..58cfcb7ce 100644 --- a/src/zonemaster/zonemaster.conf.in +++ b/src/zonemaster/zonemaster.conf.in | |||
@@ -1,6 +1,6 @@ | |||
1 | [zonemaster] | 1 | [zonemaster] |
2 | AUTOSTART = @AUTOSTART@ | 2 | START_ON_DEMAND = @START_ON_DEMAND@ |
3 | FORCESTART = YES | 3 | IMMEDIATE_START = YES |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | BINARY = gnunet-service-zonemaster | 5 | BINARY = gnunet-service-zonemaster |
6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-zonemaster.sock | 6 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-zonemaster.sock |
@@ -27,8 +27,8 @@ ZONE_PUBLISH_TIME_WINDOW = 4 h | |||
27 | 27 | ||
28 | 28 | ||
29 | [zonemaster-monitor] | 29 | [zonemaster-monitor] |
30 | AUTOSTART = @AUTOSTART@ | 30 | START_ON_DEMAND = @START_ON_DEMAND@ |
31 | FORCESTART = YES | 31 | IMMEDIATE_START = YES |
32 | HOSTNAME = localhost | 32 | HOSTNAME = localhost |
33 | BINARY = gnunet-service-zonemaster-monitor | 33 | BINARY = gnunet-service-zonemaster-monitor |
34 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-zonemaster-monitor.sock | 34 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-zonemaster-monitor.sock |