aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_remove_not_existing_record.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-01 16:48:01 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-01 16:48:01 +0000
commit8d3546bdb0e458da96092f76dc4d2735c747335d (patch)
treeb595adcb8240dfa45cc32cf53fe120c3f15661a3 /src/namestore/test_namestore_api_remove_not_existing_record.c
parentc8ee017f28ce9c5f59bdae20bd2f9c0a6c4146a7 (diff)
downloadgnunet-8d3546bdb0e458da96092f76dc4d2735c747335d.tar.gz
gnunet-8d3546bdb0e458da96092f76dc4d2735c747335d.zip
- added signature check
Diffstat (limited to 'src/namestore/test_namestore_api_remove_not_existing_record.c')
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c
index 6818e28f3..b202c9357 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -196,7 +196,7 @@ void
196remove_cont (void *cls, int32_t success, const char *emsg) 196remove_cont (void *cls, int32_t success, const char *emsg)
197{ 197{
198 char *name = cls; 198 char *name = cls;
199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s\n", name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg); 199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s `%s'\n", name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg);
200 if (success == GNUNET_OK) 200 if (success == GNUNET_OK)
201 { 201 {
202 res = 0; 202 res = 0;
@@ -219,9 +219,16 @@ put_cont (void *cls, int32_t success, const char *emsg)
219 if (success == GNUNET_OK) 219 if (success == GNUNET_OK)
220 { 220 {
221 res = 0; 221 res = 0;
222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing record for `%s'\n", name); 222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing non existing record for `%s'\n", name);
223 223
224 GNUNET_NAMESTORE_record_remove (nsh, privkey, name, &s_rd[0], &remove_cont, name); 224 struct GNUNET_NAMESTORE_RecordData rd;
225 char data[TEST_REMOVE_RECORD_DATALEN];
226 rd.expiration = GNUNET_TIME_absolute_get();
227 rd.record_type = TEST_REMOVE_RECORD_TYPE;
228 rd.data_size = TEST_REMOVE_RECORD_DATALEN;
229 rd.data = &data;
230
231 GNUNET_NAMESTORE_record_remove (nsh, privkey, name, &rd, &remove_cont, name);
225 } 232 }
226 else 233 else
227 { 234 {
@@ -238,14 +245,7 @@ create_record (int count)
238 struct GNUNET_NAMESTORE_RecordData * rd; 245 struct GNUNET_NAMESTORE_RecordData * rd;
239 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); 246 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
240 247
241 rd[0].expiration = GNUNET_TIME_absolute_get(); 248 for (c = 0; c < RECORDS; c++)
242 rd[0].record_type = 0;
243 rd[0].data_size = TEST_REMOVE_RECORD_DATALEN;
244 rd[0].data = GNUNET_malloc(TEST_RECORD_DATALEN);
245 memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN);
246
247
248 for (c = 1; c < RECORDS; c++)
249 { 249 {
250 rd[c].expiration = GNUNET_TIME_absolute_get(); 250 rd[c].expiration = GNUNET_TIME_absolute_get();
251 rd[c].record_type = TEST_RECORD_TYPE; 251 rd[c].record_type = TEST_RECORD_TYPE;
@@ -293,8 +293,6 @@ run (void *cls, char *const *args, const char *cfgfile,
293 nsh = GNUNET_NAMESTORE_connect (cfg); 293 nsh = GNUNET_NAMESTORE_connect (cfg);
294 GNUNET_break (NULL != nsh); 294 GNUNET_break (NULL != nsh);
295 295
296
297
298 GNUNET_break (s_rd != NULL); 296 GNUNET_break (s_rd != NULL);
299 GNUNET_break (s_name != NULL); 297 GNUNET_break (s_name != NULL);
300 298