gnunet-go

GNUnet Bindings for Go
Log | Files | Refs | README | LICENSE

commit be8e465cd061612133282db80ab1c7b7387ee251
parent db8edd2189c526a79039661844314081739010e1
Author: Bernd Fix <brf@hoi-polloi.org>
Date:   Wed, 19 Feb 2020 11:01:27 +0100

Fixed filtering of supplemental records and GNS2DNS handling.

Diffstat:
Msrc/gnunet/service/gns/block_handler.go | 8+++++---
Msrc/gnunet/service/gns/module.go | 4+++-
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gnunet/service/gns/block_handler.go b/src/gnunet/service/gns/block_handler.go @@ -148,10 +148,12 @@ 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 for non-supplemental records - rrType := int(rec.Type) - if (rrType & enums.GNS_FLAG_SUPPL) == 0 { - hl.counts.Add(rrType) + if (int(rec.Flags) & enums.GNS_FLAG_SUPPL) != 0 { + logger.Printf(logger.DBG, "[gns] handler_list: skip %v\n", rec) + continue } + rrType := int(rec.Type) + hl.counts.Add(rrType) // check for custom handler type if creat, ok := customHandler[rrType]; ok { diff --git a/src/gnunet/service/gns/module.go b/src/gnunet/service/gns/module.go @@ -214,7 +214,7 @@ func (gns *GNSModule) ResolveRelative(labels []string, pkey *ed25519.PublicKey, inst := hdlr.(*Gns2DnsHandler) // if we are at the end of the path and the requested type // includes GNS_TYPE_GNS2DNS, the GNS2DNS records are returned... - if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_GNS2DNS) { + if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_GNS2DNS) && !kind.IsAny() { records = inst.recs break } @@ -246,8 +246,10 @@ func (gns *GNSModule) ResolveRelative(labels []string, pkey *ed25519.PublicKey, // if we are at the end of the path and the requested type // includes GNS_TYPE_DNS_CNAME, the records are returned... if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_DNS_CNAME) && !kind.IsAny() { + logger.Println(logger.DBG, "[gns] CNAME requested.") break } + logger.Println(logger.DBG, "[gns] CNAME resolution required.") if set, err = gns.ResolveUnknown(inst.name, labels, pkey, kind, depth+1); err != nil { logger.Println(logger.ERROR, "[gns] CNAME resolution failed.") return