aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-12-06 14:33:00 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-12-06 14:33:00 +0000
commite995d358e231da11ec79aead4c91c25fbd4b563e (patch)
treee6dcb62f5b922851b89b1501bf5ce5406a528914 /src/namestore
parent91e7cad472a0ffa249a98d805594d44b66b9c87d (diff)
downloadgnunet-e995d358e231da11ec79aead4c91c25fbd4b563e.tar.gz
gnunet-e995d358e231da11ec79aead4c91c25fbd4b563e.zip
fixed uri parsing and exit codes
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 31adfabec..0a030acc5 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -306,6 +306,7 @@ add_continuation (void *cls,
306 if (GNUNET_NO != success) 306 if (GNUNET_NO != success)
307 ret = 1; 307 ret = 1;
308 } 308 }
309 ret = 0;
309 test_finished (); 310 test_finished ();
310} 311}
311 312
@@ -704,12 +705,8 @@ testservice_task (void *cls,
704 char sname[64]; 705 char sname[64];
705 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 706 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
706 707
707 if ( (2 != (sscanf (uri, 708 if ( (2 != (sscanf (uri, "gnunet://gns/%52s/%63s", sh, sname)) ) ||
708 "gnunet://gns/%104s/%63s", 709 (GNUNET_OK != GNUNET_CRYPTO_ecdsa_public_key_from_string (sh, strlen (sh), &pkey)) )
709 sh,
710 sname)) ) ||
711 (GNUNET_OK !=
712 GNUNET_CRYPTO_ecdsa_public_key_from_string (sh, strlen (sh), &pkey)) )
713 { 710 {
714 fprintf (stderr, 711 fprintf (stderr,
715 _("Invalid URI `%s'\n"), 712 _("Invalid URI `%s'\n"),
@@ -732,7 +729,7 @@ testservice_task (void *cls,
732 else 729 else
733 rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; 730 rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
734 731
735 if (1 != shadow) 732 if (1 == shadow)
736 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 733 rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
737 add_qe_uri = GNUNET_NAMESTORE_records_store (ns, 734 add_qe_uri = GNUNET_NAMESTORE_records_store (ns,
738 &zone_pkey, 735 &zone_pkey,
@@ -791,6 +788,7 @@ identity_cb (void *cls,
791 ego_name); 788 ego_name);
792 } 789 }
793 GNUNET_SCHEDULER_shutdown (); 790 GNUNET_SCHEDULER_shutdown ();
791 ret = -1;
794 return; 792 return;
795 } 793 }
796 zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); 794 zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
@@ -815,6 +813,7 @@ default_ego_cb (void *cls,
815 fprintf (stderr, 813 fprintf (stderr,
816 _("No default ego configured in identity service\n")); 814 _("No default ego configured in identity service\n"));
817 GNUNET_SCHEDULER_shutdown (); 815 GNUNET_SCHEDULER_shutdown ();
816 ret = -1;
818 return; 817 return;
819 } 818 }
820 else 819 else
@@ -847,6 +846,7 @@ testservice_id_task (void *cls, int result)
847 fprintf (stderr, 846 fprintf (stderr,
848 _("Identity service is not running\n")); 847 _("Identity service is not running\n"));
849 GNUNET_SCHEDULER_shutdown (); 848 GNUNET_SCHEDULER_shutdown ();
849 ret = -1;
850 return; 850 return;
851 } 851 }
852 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 852 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -857,6 +857,7 @@ testservice_id_task (void *cls, int result)
857 idh = GNUNET_IDENTITY_connect (cfg, &id_connect_cb, (void *) cfg); 857 idh = GNUNET_IDENTITY_connect (cfg, &id_connect_cb, (void *) cfg);
858 if (NULL == idh) 858 if (NULL == idh)
859 fprintf (stderr, _("Cannot connect to identity service\n")); 859 fprintf (stderr, _("Cannot connect to identity service\n"));
860 ret = -1;
860 return; 861 return;
861 } 862 }
862 el = GNUNET_IDENTITY_ego_lookup (cfg, 863 el = GNUNET_IDENTITY_ego_lookup (cfg,