Skip to content

Commit

Permalink
fix an obvious issue from early regulation & reverse statement
Browse files Browse the repository at this point in the history
(cherry picked from commit 4d13178)
  • Loading branch information
AZ-X committed Jul 6, 2022
1 parent 91bf74f commit 824154e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions repique/features/dns/nodes/dnscrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 1 addition & 7 deletions repique/protocols/dnscrypt/dnscrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 824154e

Please sign in to comment.