gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-go] 02/02: Fixed filtering of supplemental records and GNS2DNS h


From: gnunet
Subject: [gnunet-go] 02/02: Fixed filtering of supplemental records and GNS2DNS handling.
Date: Wed, 19 Feb 2020 11:06:25 +0100

This is an automated email from the git hooks/post-receive script.

bernd-fix pushed a commit to branch master
in repository gnunet-go.

commit be8e465cd061612133282db80ab1c7b7387ee251
Author: Bernd Fix <address@hidden>
AuthorDate: Wed Feb 19 11:01:27 2020 +0100

    Fixed filtering of supplemental records and GNS2DNS handling.
---
 src/gnunet/service/gns/block_handler.go | 8 +++++---
 src/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
index 1d5a9e5..3b3438d 100644
--- 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
index e8d8847..d067633 100644
--- 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

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]