aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-29 12:46:11 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-29 12:46:11 +0000
commit832b1a2cf43ed62dbd17827ca7d60a6cebd0066d (patch)
tree5bec4841b9be978d8f2f840ba967977cec1d336b /src/namestore
parent11645b434e02dbc136c8f44237ba7c08058dd476 (diff)
downloadgnunet-832b1a2cf43ed62dbd17827ca7d60a6cebd0066d.tar.gz
gnunet-832b1a2cf43ed62dbd17827ca7d60a6cebd0066d.zip
-check all fields for matches before removing
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-service-namestore.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index dd1e3f69d..81639fcab 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -1229,20 +1229,11 @@ handle_record_remove_it (void *cls,
1229 found = -1; 1229 found = -1;
1230 for (c = 0; c < rd_count; c++) 1230 for (c = 0; c < rd_count; c++)
1231 { 1231 {
1232 /* FIXME: shouldn't we test for all fields to match? Otherwise 1232 if ( (rd[c].flags != rrc->rd->flags) ||
1233 we might remove the wrong record, just because the type matches! */ 1233 (rd[c].record_type != rrc->rd->record_type) ||
1234 /* 1234 (rd[c].data_size != rrc->rd->data_size) ||
1235 if (rd[c].flags != rrc->rd->flags) 1235 (0 != memcmp (rd[c].data, rrc->rd->data, rrc->rd->data_size)) )
1236 continue;*/ 1236 continue;
1237 if (rd[c].record_type != rrc->rd->record_type)
1238 continue;
1239 /*
1240 if (rd[c].data_size != rrc->rd->data_size)
1241 continue;
1242 GNUNET_break(0);
1243 if (0 != memcmp (rd[c].data, rrc->rd->data, rrc->rd->data_size))
1244 continue;
1245 GNUNET_break(0); */
1246 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found record to remove!\n", rd_count); 1237 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found record to remove!\n", rd_count);
1247 found = c; 1238 found = c;
1248 break; 1239 break;