summaryrefslogtreecommitdiff
path: root/src/testing/testing.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-07-02 21:39:16 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-07-02 21:39:16 +0000
commitcd5d883c4068daff30217ae8ec93ba2fb10a699a (patch)
tree7380aa21bb255caddf0e33f15f070fb2aa94faf6 /src/testing/testing.c
parent39d195cdbb82baaf20714841d87f865caea5573d (diff)
downloadgnunet-cd5d883c4068daff30217ae8ec93ba2fb10a699a.tar.gz
gnunet-cd5d883c4068daff30217ae8ec93ba2fb10a699a.zip
added TESTING_IGNORE_KEYS
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r--src/testing/testing.c53
1 files changed, 50 insertions, 3 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index bba38ead3..87c432fb1 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -614,12 +614,59 @@ static void
614update_config_sections (void *cls, 614update_config_sections (void *cls,
615 const char *section) 615 const char *section)
616{ 616{
617 struct UpdateContext *uc = cls; 617 struct UpdateContext *uc = cls;
618 char **ikeys;
619 char *val;
620 char *ptr;
618 char *orig_allowed_hosts; 621 char *orig_allowed_hosts;
619 char *allowed_hosts; 622 char *allowed_hosts;
623 uint16_t ikeys_cnt;
624 uint16_t key;
625
626 ikeys_cnt = 0;
627 val = NULL;
628 if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (uc->cfg, section,
629 "TESTING_IGNORE_KEYS"))
630 {
631 GNUNET_assert
632 (GNUNET_YES ==
633 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section,
634 "TESTING_IGNORE_KEYS", &val));
635 ptr = val;
636 for (ikeys_cnt = 0; NULL != (ptr = strstr (ptr, ";")); ikeys_cnt++)
637 ptr++;
638 if (0 == ikeys_cnt)
639 GNUNET_break (0);
640 else
641 {
642 ikeys = GNUNET_malloc ((sizeof (char *)) * ikeys_cnt);
643 ptr = val;
644 for (key = 0; key < ikeys_cnt; key++)
645 {
646 ikeys[key] = ptr;
647 ptr = strstr (ptr, ";");
648 *ptr = '\0';
649 ptr++;
650 }
651 }
652 }
653 if (0 != ikeys_cnt)
654 {
655 for (key = 0; key < ikeys_cnt; key++)
656 {
657 if (NULL != strstr (ikeys[key], "ACCEPT_FROM"))
658 {
659 GNUNET_free (ikeys);
660 GNUNET_free (val);
661 return;
662 }
663 }
664 GNUNET_free (ikeys);
665 }
666 GNUNET_free_non_null (val);
620 667
621 if (NULL != strstr (section, "transport-")) 668 /* if (NULL != strstr (section, "transport-")) */
622 return; 669 /* return; */
623 670
624 if (GNUNET_OK != 671 if (GNUNET_OK !=
625 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM", 672 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM",