diff --git a/repique/features/dns/nodes/dnscrypt.go b/repique/features/dns/nodes/dnscrypt.go index 04e1793..5e9e0da 100644 --- a/repique/features/dns/nodes/dnscrypt.go +++ b/repique/features/dns/nodes/dnscrypt.go @@ -84,10 +84,10 @@ func (n *dnscryptnode) marshal() *struct{c uint8; v string} { return &struct{c uint8; v string} {count, c.String()} } -func (n *dnscryptnode) unmarshal(ss *struct{c uint8; v string}) (to *time.Time) { +func (n *dnscryptnode) unmarshal(ss *struct{c uint8; v string}) (to *time.Time) { + c := strings.NewReader(ss.v) for i := ss.c; i > 0; i -- { s := &dnscrypt.ServiceInfo{Service:&dnscrypt.Service{ServerKey:&dnscrypt.ServerKey{}}} - c := strings.NewReader(ss.v) var mq, sk []byte if _, err := fmt.Fscanf(c, dnscryptmarshalfmt, &s.Version, &s.Minor, &s.Serial, &s.DtFrom, &s.DtTo, &s.Regular, &mq, &sk); err != nil { diff --git a/repique/protocols/dnscrypt/dnscrypt.go b/repique/protocols/dnscrypt/dnscrypt.go index f808b90..034cd1f 100644 --- a/repique/protocols/dnscrypt/dnscrypt.go +++ b/repique/protocols/dnscrypt/dnscrypt.go @@ -316,16 +316,10 @@ RowLoop: for _, si := range sis { if _, found := keys[*si.ServerKey]; !found { deleted[*si.ServerKey] = nil + *sis0 = append(*sis0, si) } else { delete(keys, *si.ServerKey) - for p:= len(*sis0); p != 0; p-- { - if *si.ServerKey == *(*sis0)[p-1].ServerKey { - *sis0 = append((*sis0)[0:p-1], (*sis0)[p:]...) - break - } - } } - *sis0 = append(*sis0, si) } } visitFn(resolver.V1_Services.Load().([]*ServiceInfo), &v1_Services)