diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-05 19:58:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-05 19:58:51 +0000 |
commit | 56f3001a4d745dfa5ad196c1b18c672145c89f4c (patch) | |
tree | 90edfb1a42af668477969ba2e33f63683bf76ecc /src/namestore | |
parent | fb446b66a47ace773b9768b1d0c1da9c4c2f43b1 (diff) | |
download | gnunet-56f3001a4d745dfa5ad196c1b18c672145c89f4c.tar.gz gnunet-56f3001a4d745dfa5ad196c1b18c672145c89f4c.zip |
-initialize flags to unproblematic value (hence usually zero)
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_private.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_lookup_public.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_monitoring.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_monitoring_existing.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_put.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_store.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration.c | 1 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_specific_zone.c | 37 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_stop.c | 19 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_to_name.c | 14 | ||||
-rw-r--r-- | src/namestore/test_plugin_namestore.c | 4 |
12 files changed, 49 insertions, 33 deletions
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c index e1aa6b8b8..3b997ed0e 100644 --- a/src/namestore/test_namestore_api_lookup_private.c +++ b/src/namestore/test_namestore_api_lookup_private.c | |||
@@ -186,6 +186,7 @@ run (void *cls, | |||
186 | rd.record_type = TEST_RECORD_TYPE; | 186 | rd.record_type = TEST_RECORD_TYPE; |
187 | rd.data_size = TEST_RECORD_DATALEN; | 187 | rd.data_size = TEST_RECORD_DATALEN; |
188 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); | 188 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); |
189 | rd.flags = 0; | ||
189 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); | 190 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); |
190 | 191 | ||
191 | nsh = GNUNET_NAMESTORE_connect (cfg); | 192 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c index 42f8fe401..a0678ddc4 100644 --- a/src/namestore/test_namestore_api_lookup_public.c +++ b/src/namestore/test_namestore_api_lookup_public.c | |||
@@ -210,6 +210,7 @@ run (void *cls, | |||
210 | rd.record_type = TEST_RECORD_TYPE; | 210 | rd.record_type = TEST_RECORD_TYPE; |
211 | rd.data_size = TEST_RECORD_DATALEN; | 211 | rd.data_size = TEST_RECORD_DATALEN; |
212 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); | 212 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); |
213 | rd.flags = 0; | ||
213 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); | 214 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); |
214 | 215 | ||
215 | nsh = GNUNET_NAMESTORE_connect (cfg); | 216 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c index a0a5ec4b6..6a2418e46 100644 --- a/src/namestore/test_namestore_api_monitoring.c +++ b/src/namestore/test_namestore_api_monitoring.c | |||
@@ -253,6 +253,7 @@ create_record (unsigned int count) | |||
253 | rd[c].record_type = 1111; | 253 | rd[c].record_type = 1111; |
254 | rd[c].data_size = 50; | 254 | rd[c].data_size = 50; |
255 | rd[c].data = GNUNET_malloc(50); | 255 | rd[c].data = GNUNET_malloc(50); |
256 | rd[c].flags = 0; | ||
256 | memset ((char *) rd[c].data, 'a', 50); | 257 | memset ((char *) rd[c].data, 'a', 50); |
257 | } | 258 | } |
258 | return rd; | 259 | return rd; |
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c index 16e4e4157..51cd1205d 100644 --- a/src/namestore/test_namestore_api_monitoring_existing.c +++ b/src/namestore/test_namestore_api_monitoring_existing.c | |||
@@ -266,6 +266,7 @@ create_record (unsigned int count) | |||
266 | rd[c].record_type = 1111; | 266 | rd[c].record_type = 1111; |
267 | rd[c].data_size = 50; | 267 | rd[c].data_size = 50; |
268 | rd[c].data = GNUNET_malloc(50); | 268 | rd[c].data = GNUNET_malloc(50); |
269 | rd[c].flags = 0; | ||
269 | memset ((char *) rd[c].data, 'a', 50); | 270 | memset ((char *) rd[c].data, 'a', 50); |
270 | } | 271 | } |
271 | return rd; | 272 | return rd; |
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c index 4f06283c1..53a702a32 100644 --- a/src/namestore/test_namestore_api_put.c +++ b/src/namestore/test_namestore_api_put.c | |||
@@ -124,6 +124,7 @@ create_record (unsigned int count) | |||
124 | rd[c].record_type = TEST_RECORD_TYPE; | 124 | rd[c].record_type = TEST_RECORD_TYPE; |
125 | rd[c].data_size = TEST_RECORD_DATALEN; | 125 | rd[c].data_size = TEST_RECORD_DATALEN; |
126 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 126 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
127 | rd[c].flags = 0; | ||
127 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 128 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
128 | } | 129 | } |
129 | return rd; | 130 | return rd; |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 9fdf738b1..7c8f47f5d 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -171,6 +171,7 @@ run (void *cls, | |||
171 | rd.record_type = TEST_RECORD_TYPE; | 171 | rd.record_type = TEST_RECORD_TYPE; |
172 | rd.data_size = TEST_RECORD_DATALEN; | 172 | rd.data_size = TEST_RECORD_DATALEN; |
173 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); | 173 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); |
174 | rd.flags = 0; | ||
174 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); | 175 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); |
175 | 176 | ||
176 | nsh = GNUNET_NAMESTORE_connect (cfg); | 177 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c index 424c826b7..85c4a2806 100644 --- a/src/namestore/test_namestore_api_store.c +++ b/src/namestore/test_namestore_api_store.c | |||
@@ -134,6 +134,7 @@ run (void *cls, | |||
134 | rd.record_type = TEST_RECORD_TYPE; | 134 | rd.record_type = TEST_RECORD_TYPE; |
135 | rd.data_size = TEST_RECORD_DATALEN; | 135 | rd.data_size = TEST_RECORD_DATALEN; |
136 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); | 136 | rd.data = GNUNET_malloc (TEST_RECORD_DATALEN); |
137 | rd.flags = 0; | ||
137 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); | 138 | memset ((char *) rd.data, 'a', TEST_RECORD_DATALEN); |
138 | 139 | ||
139 | nsh = GNUNET_NAMESTORE_connect (cfg); | 140 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 7ff21a39d..f2eb1d17b 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -330,6 +330,7 @@ create_record (unsigned int count) | |||
330 | rd[c].record_type = 1111; | 330 | rd[c].record_type = 1111; |
331 | rd[c].data_size = 50; | 331 | rd[c].data_size = 50; |
332 | rd[c].data = GNUNET_malloc(50); | 332 | rd[c].data = GNUNET_malloc(50); |
333 | rd[c].flags = 0; | ||
333 | memset ((char *) rd[c].data, 'a', 50); | 334 | memset ((char *) rd[c].data, 'a', 50); |
334 | } | 335 | } |
335 | return rd; | 336 | return rd; |
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index fdaef8d90..6b131528e 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c | |||
@@ -310,6 +310,7 @@ create_record (unsigned int count) | |||
310 | rd[c].record_type = 1111; | 310 | rd[c].record_type = 1111; |
311 | rd[c].data_size = 50; | 311 | rd[c].data_size = 50; |
312 | rd[c].data = GNUNET_malloc(50); | 312 | rd[c].data = GNUNET_malloc(50); |
313 | rd[c].flags = 0; | ||
313 | memset ((char *) rd[c].data, 'a', 50); | 314 | memset ((char *) rd[c].data, 'a', 50); |
314 | } | 315 | } |
315 | return rd; | 316 | return rd; |
@@ -331,26 +332,26 @@ empty_zone_proc (void *cls, | |||
331 | char *hostkey_file; | 332 | char *hostkey_file; |
332 | 333 | ||
333 | GNUNET_assert (nsh == cls); | 334 | GNUNET_assert (nsh == cls); |
334 | if (NULL != zone) | 335 | if (NULL != zone) |
335 | { | 336 | { |
336 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 337 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
337 | _("Expected empty zone but received zone private key\n")); | 338 | _("Expected empty zone but received zone private key\n")); |
338 | GNUNET_break (0); | 339 | GNUNET_break (0); |
339 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 340 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
340 | GNUNET_SCHEDULER_cancel (endbadly_task); | 341 | GNUNET_SCHEDULER_cancel (endbadly_task); |
341 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | 342 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
342 | return; | 343 | return; |
343 | } | 344 | } |
344 | if ((NULL != label) || (NULL != rd) || (0 != rd_count)) | 345 | if ((NULL != label) || (NULL != rd) || (0 != rd_count)) |
345 | { | 346 | { |
346 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 347 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
347 | _("Expected no zone content but received data\n")); | 348 | _("Expected no zone content but received data\n")); |
348 | GNUNET_break (0); | 349 | GNUNET_break (0); |
349 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 350 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
350 | GNUNET_SCHEDULER_cancel (endbadly_task); | 351 | GNUNET_SCHEDULER_cancel (endbadly_task); |
351 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | 352 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
352 | return; | 353 | return; |
353 | } | 354 | } |
354 | 355 | ||
355 | 356 | ||
356 | zi = NULL; | 357 | zi = NULL; |
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index f2a3f7940..728a118eb 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -110,11 +110,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
110 | static void | 110 | static void |
111 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 111 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
112 | { | 112 | { |
113 | if (NULL != zi) | 113 | if (NULL != zi) |
114 | { | 114 | { |
115 | GNUNET_NAMESTORE_zone_iteration_stop (zi); | 115 | GNUNET_NAMESTORE_zone_iteration_stop (zi); |
116 | zi = NULL; | 116 | zi = NULL; |
117 | } | 117 | } |
118 | 118 | ||
119 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 119 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
120 | { | 120 | { |
@@ -156,10 +156,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
156 | 156 | ||
157 | static void | 157 | static void |
158 | zone_proc (void *cls, | 158 | zone_proc (void *cls, |
159 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 159 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
160 | const char *label, | 160 | const char *label, |
161 | unsigned int rd_count, | 161 | unsigned int rd_count, |
162 | const struct GNUNET_GNSRECORD_Data *rd) | 162 | const struct GNUNET_GNSRECORD_Data *rd) |
163 | { | 163 | { |
164 | int failed = GNUNET_NO; | 164 | int failed = GNUNET_NO; |
165 | if ((zone == NULL) && (label == NULL)) | 165 | if ((zone == NULL) && (label == NULL)) |
@@ -344,6 +344,7 @@ create_record (unsigned int count) | |||
344 | rd[c].record_type = 1111; | 344 | rd[c].record_type = 1111; |
345 | rd[c].data_size = 50; | 345 | rd[c].data_size = 50; |
346 | rd[c].data = GNUNET_malloc(50); | 346 | rd[c].data = GNUNET_malloc(50); |
347 | rd[c].flags = 0; | ||
347 | memset ((char *) rd[c].data, 'a', 50); | 348 | memset ((char *) rd[c].data, 'a', 50); |
348 | } | 349 | } |
349 | return rd; | 350 | return rd; |
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); |
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index dc40120d4..21aaa0f7d 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -100,7 +100,7 @@ test_record (void *cls, | |||
100 | GNUNET_assert (rd[i].data_size == id % 10); | 100 | GNUNET_assert (rd[i].data_size == id % 10); |
101 | GNUNET_assert (0 == memcmp ("Hello World", rd[i].data, id % 10)); | 101 | GNUNET_assert (0 == memcmp ("Hello World", rd[i].data, id % 10)); |
102 | GNUNET_assert (rd[i].record_type == 1 + (id % 13)); | 102 | GNUNET_assert (rd[i].record_type == 1 + (id % 13)); |
103 | GNUNET_assert (rd[i].flags == (id % 7)); | 103 | GNUNET_assert (rd[i].flags == 0); |
104 | } | 104 | } |
105 | memset (&tzone_private_key, (id % 241), sizeof (tzone_private_key)); | 105 | memset (&tzone_private_key, (id % 241), sizeof (tzone_private_key)); |
106 | GNUNET_assert (0 == strcmp (label, tname)); | 106 | GNUNET_assert (0 == strcmp (label, tname)); |
@@ -134,7 +134,7 @@ put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
134 | rd[i].data_size = id % 10; | 134 | rd[i].data_size = id % 10; |
135 | rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value_us; | 135 | rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value_us; |
136 | rd[i].record_type = 1 + (id % 13); | 136 | rd[i].record_type = 1 + (id % 13); |
137 | rd[i].flags = (id % 7); | 137 | rd[i].flags = 0; |
138 | } | 138 | } |
139 | memset (&zone_private_key, (id % 241), sizeof (zone_private_key)); | 139 | memset (&zone_private_key, (id % 241), sizeof (zone_private_key)); |
140 | memset (&signature, (id % 243), sizeof (signature)); | 140 | memset (&signature, (id % 243), sizeof (signature)); |