commit 7e13256995f3af254d8637a9eb44a2702c6ef541
parent 3cb6b7af3c798ef125e578a220d70c82439dcd5f
Author: Bernd Fix <brf@hoi-polloi.org>
Date: Sat, 15 Feb 2020 12:06:55 +0100
Add handling for supplemental records.
Diffstat:
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/gnunet/enums/gns.go b/src/gnunet/enums/gns.go
@@ -23,9 +23,10 @@ var (
GNS_MAX_BLOCK_SIZE = (63 * 1024) // Maximum size of a value that can be stored in a GNS block.
// GNS record flags
- GNS_FLAG_PRIVATE = 2
- GNS_FLAGS_EXPREL = 8
- GNS_FLAG_SHADOW = 16
+ GNS_FLAG_PRIVATE = 2 // Record is not shared on the DHT
+ GNS_FLAG_SUPPL = 4 // Supplemental records (e.g. NICK) in a block
+ GNS_FLAG_EXPREL = 8 // Expire time in record is in relative time.
+ GNS_FLAG_SHADOW = 16 // Record is ignored if non-expired records of same type exist in block
// GNS record types
GNS_TYPE_ANY = 0 // Record type indicating any record/'*'
diff --git a/src/gnunet/service/gns/block_handler.go b/src/gnunet/service/gns/block_handler.go
@@ -147,9 +147,11 @@ func NewBlockHandlerList(records []*message.GNSResourceRecord, labels []string)
// Third pass: Traverse active list and build list of handler instances.
for _, rec := range active {
- // update counter map
+ // update counter map for non-supplemental records
rrType := int(rec.Type)
- hl.counts.Add(rrType)
+ if (rrType & enums.GNS_FLAG_SUPPL) == 0 {
+ hl.counts.Add(rrType)
+ }
// check for custom handler type
if creat, ok := customHandler[rrType]; ok {