diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-25 11:33:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-25 11:33:14 +0000 |
commit | 6b13a87d2165669c5b0f4a16b4c599d9cf0ac1db (patch) | |
tree | 402c187ada7749cb0205d107059b09f3373f0a8b /src/namestore/gnunet-namestore.c | |
parent | bc3f45a82f10905c9630618e12cb062348cf21ac (diff) | |
download | gnunet-6b13a87d2165669c5b0f4a16b4c599d9cf0ac1db.tar.gz gnunet-6b13a87d2165669c5b0f4a16b4c599d9cf0ac1db.zip |
-nicer indentation
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r-- | src/namestore/gnunet-namestore.c | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 82213497c..9e654cc34 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -411,7 +411,8 @@ display_record (void *cls, | |||
411 | rd[i].data_size); | 411 | rd[i].data_size); |
412 | if (NULL == s) | 412 | if (NULL == s) |
413 | { | 413 | { |
414 | FPRINTF (stdout, _("\tCorrupt or unsupported record of type %u\n"), | 414 | FPRINTF (stdout, |
415 | _("\tCorrupt or unsupported record of type %u\n"), | ||
415 | (unsigned int) rd[i].record_type); | 416 | (unsigned int) rd[i].record_type); |
416 | continue; | 417 | continue; |
417 | } | 418 | } |
@@ -579,7 +580,9 @@ get_existing_record (void *cls, | |||
579 | break; | 580 | break; |
580 | } | 581 | } |
581 | memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); | 582 | memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); |
582 | GNUNET_memcpy (&rdn[1], rd, rd_count * sizeof (struct GNUNET_GNSRECORD_Data)); | 583 | GNUNET_memcpy (&rdn[1], |
584 | rd, | ||
585 | rd_count * sizeof (struct GNUNET_GNSRECORD_Data)); | ||
583 | rde = &rdn[0]; | 586 | rde = &rdn[0]; |
584 | rde->data = data; | 587 | rde->data = data; |
585 | rde->data_size = data_size; | 588 | rde->data_size = data_size; |
@@ -846,7 +849,8 @@ testservice_task (void *cls, | |||
846 | { | 849 | { |
847 | fprintf (stderr, | 850 | fprintf (stderr, |
848 | _("Missing option `%s' for operation `%s'\n"), | 851 | _("Missing option `%s' for operation `%s'\n"), |
849 | "-e", _("add")); | 852 | "-e", |
853 | _("add")); | ||
850 | GNUNET_SCHEDULER_shutdown (); | 854 | GNUNET_SCHEDULER_shutdown (); |
851 | ret = 1; | 855 | ret = 1; |
852 | return; | 856 | return; |
@@ -862,12 +866,19 @@ testservice_task (void *cls, | |||
862 | &etime_rel)) | 866 | &etime_rel)) |
863 | { | 867 | { |
864 | etime_is_rel = GNUNET_YES; | 868 | etime_is_rel = GNUNET_YES; |
869 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
870 | "Storing record with relative expiration time of %s\n", | ||
871 | GNUNET_STRINGS_relative_time_to_string (etime_rel, | ||
872 | GNUNET_NO)); | ||
865 | } | 873 | } |
866 | else if (GNUNET_OK == | 874 | else if (GNUNET_OK == |
867 | GNUNET_STRINGS_fancy_time_to_absolute (expirationstring, | 875 | GNUNET_STRINGS_fancy_time_to_absolute (expirationstring, |
868 | &etime_abs)) | 876 | &etime_abs)) |
869 | { | 877 | { |
870 | etime_is_rel = GNUNET_NO; | 878 | etime_is_rel = GNUNET_NO; |
879 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
880 | "Storing record with absolute expiration time of %s\n", | ||
881 | GNUNET_STRINGS_absolute_time_to_string (etime_abs)); | ||
871 | } | 882 | } |
872 | else | 883 | else |
873 | { | 884 | { |
@@ -996,8 +1007,11 @@ testservice_task (void *cls, | |||
996 | ret = 1; | 1007 | ret = 1; |
997 | return; | 1008 | return; |
998 | } | 1009 | } |
999 | add_qe_uri = GNUNET_NAMESTORE_set_nick(ns, &zone_pkey, nickstring, | 1010 | add_qe_uri = GNUNET_NAMESTORE_set_nick(ns, |
1000 | &add_continuation, &add_qe_uri); | 1011 | &zone_pkey, |
1012 | nickstring, | ||
1013 | &add_continuation, | ||
1014 | &add_qe_uri); | ||
1001 | } | 1015 | } |
1002 | if (monitor) | 1016 | if (monitor) |
1003 | { | 1017 | { |
@@ -1084,7 +1098,8 @@ id_connect_cb (void *cls, | |||
1084 | { | 1098 | { |
1085 | get_default = GNUNET_IDENTITY_get (idh, | 1099 | get_default = GNUNET_IDENTITY_get (idh, |
1086 | "namestore", | 1100 | "namestore", |
1087 | &default_ego_cb, (void *) cfg); | 1101 | &default_ego_cb, |
1102 | (void *) cfg); | ||
1088 | } | 1103 | } |
1089 | } | 1104 | } |
1090 | 1105 | ||
@@ -1093,6 +1108,7 @@ static void | |||
1093 | testservice_id_task (void *cls, int result) | 1108 | testservice_id_task (void *cls, int result) |
1094 | { | 1109 | { |
1095 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; | 1110 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; |
1111 | |||
1096 | if (result != GNUNET_YES) | 1112 | if (result != GNUNET_YES) |
1097 | { | 1113 | { |
1098 | fprintf (stderr, | 1114 | fprintf (stderr, |
@@ -1101,11 +1117,14 @@ testservice_id_task (void *cls, int result) | |||
1101 | ret = -1; | 1117 | ret = -1; |
1102 | return; | 1118 | return; |
1103 | } | 1119 | } |
1104 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, (void *) cfg); | 1120 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, |
1121 | (void *) cfg); | ||
1105 | 1122 | ||
1106 | if (NULL == ego_name) | 1123 | if (NULL == ego_name) |
1107 | { | 1124 | { |
1108 | idh = GNUNET_IDENTITY_connect (cfg, &id_connect_cb, (void *) cfg); | 1125 | idh = GNUNET_IDENTITY_connect (cfg, |
1126 | &id_connect_cb, | ||
1127 | (void *) cfg); | ||
1109 | if (NULL == idh) | 1128 | if (NULL == idh) |
1110 | fprintf (stderr, _("Cannot connect to identity service\n")); | 1129 | fprintf (stderr, _("Cannot connect to identity service\n")); |
1111 | ret = -1; | 1130 | ret = -1; |
@@ -1127,7 +1146,9 @@ testservice_id_task (void *cls, int result) | |||
1127 | * @param cfg configuration | 1146 | * @param cfg configuration |
1128 | */ | 1147 | */ |
1129 | static void | 1148 | static void |
1130 | run (void *cls, char *const *args, const char *cfgfile, | 1149 | run (void *cls, |
1150 | char *const *args, | ||
1151 | const char *cfgfile, | ||
1131 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 1152 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
1132 | { | 1153 | { |
1133 | if ( (NULL != args[0]) && (NULL == uri) ) | 1154 | if ( (NULL != args[0]) && (NULL == uri) ) |
@@ -1148,7 +1169,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1148 | * @return 0 ok, 1 on error | 1169 | * @return 0 ok, 1 on error |
1149 | */ | 1170 | */ |
1150 | int | 1171 | int |
1151 | main (int argc, char *const *argv) | 1172 | main (int argc, |
1173 | char *const *argv) | ||
1152 | { | 1174 | { |
1153 | is_public = -1; | 1175 | is_public = -1; |
1154 | is_shadow = -1; | 1176 | is_shadow = -1; |
@@ -1202,9 +1224,13 @@ main (int argc, char *const *argv) | |||
1202 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 1224 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
1203 | return 2; | 1225 | return 2; |
1204 | 1226 | ||
1205 | GNUNET_log_setup ("gnunet-namestore", "WARNING", NULL); | 1227 | GNUNET_log_setup ("gnunet-namestore", |
1228 | "WARNING", | ||
1229 | NULL); | ||
1206 | if (GNUNET_OK != | 1230 | if (GNUNET_OK != |
1207 | GNUNET_PROGRAM_run (argc, argv, "gnunet-namestore", | 1231 | GNUNET_PROGRAM_run (argc, |
1232 | argv, | ||
1233 | "gnunet-namestore", | ||
1208 | _("GNUnet zone manipulation tool"), | 1234 | _("GNUnet zone manipulation tool"), |
1209 | options, | 1235 | options, |
1210 | &run, NULL)) | 1236 | &run, NULL)) |