aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_to_name.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-05 19:58:51 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-05 19:58:51 +0000
commit56f3001a4d745dfa5ad196c1b18c672145c89f4c (patch)
tree90edfb1a42af668477969ba2e33f63683bf76ecc /src/namestore/test_namestore_api_zone_to_name.c
parentfb446b66a47ace773b9768b1d0c1da9c4c2f43b1 (diff)
downloadgnunet-56f3001a4d745dfa5ad196c1b18c672145c89f4c.tar.gz
gnunet-56f3001a4d745dfa5ad196c1b18c672145c89f4c.zip
-initialize flags to unproblematic value (hence usually zero)
Diffstat (limited to 'src/namestore/test_namestore_api_zone_to_name.c')
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 5c5eff87c..c7cbe0ebe 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -153,7 +153,8 @@ put_cont (void *cls, int32_t success, const char *emsg)
153 else 153 else
154 { 154 {
155 res = 1; 155 res = 1;
156 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to put records for name `%s'\n", name); 156 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
157 "Failed to put records for name `%s'\n", name);
157 GNUNET_SCHEDULER_add_now(&end, NULL); 158 GNUNET_SCHEDULER_add_now(&end, NULL);
158 } 159 }
159} 160}
@@ -167,12 +168,14 @@ run (void *cls,
167 struct GNUNET_TIME_Absolute et; 168 struct GNUNET_TIME_Absolute et;
168 169
169 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); 170 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
170 GNUNET_asprintf(&s_name, "dummy"); 171 GNUNET_asprintf (&s_name, "dummy");
171 /* load privat key */ 172 /* load privat key */
172 char *hostkey_file; 173 char *hostkey_file;
173 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, 174 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
174 "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); 175 "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey");
175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); 176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
177 "Using zonekey file `%s'\n",
178 hostkey_file);
176 privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file); 179 privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file(hostkey_file);
177 GNUNET_free (hostkey_file); 180 GNUNET_free (hostkey_file);
178 GNUNET_assert (privkey != NULL); 181 GNUNET_assert (privkey != NULL);
@@ -182,13 +185,16 @@ run (void *cls,
182 /* zone hash */ 185 /* zone hash */
183 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), &s_zone); 186 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey), &s_zone);
184 GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); 187 GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value);
185 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); 188 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
189 "Using PKEY `%s' \n",
190 GNUNET_NAMESTORE_short_h2s (&s_zone_value));
186 191
187 struct GNUNET_GNSRECORD_Data rd; 192 struct GNUNET_GNSRECORD_Data rd;
188 rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; 193 rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us;
189 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; 194 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
190 rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); 195 rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode);
191 rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode)); 196 rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode));
197 rd.flags = 0;
192 memcpy ((char *) rd.data, &s_zone_value, sizeof (struct GNUNET_CRYPTO_ShortHashCode)); 198 memcpy ((char *) rd.data, &s_zone_value, sizeof (struct GNUNET_CRYPTO_ShortHashCode));
193 nsh = GNUNET_NAMESTORE_connect (cfg); 199 nsh = GNUNET_NAMESTORE_connect (cfg);
194 GNUNET_break (NULL != nsh); 200 GNUNET_break (NULL != nsh);