Skip to content

Commit

Permalink
Client: wait for resolved IP addresses for a certain service before s…
Browse files Browse the repository at this point in the history
…ending reply to client
  • Loading branch information
grandcat committed Jul 25, 2016
1 parent e16f7d3 commit 5fa27e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"sync"

"github.com/miekg/dns"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"github.com/miekg/dns"
)

// Main client data structure to run browse/lookup queries
Expand Down Expand Up @@ -226,6 +226,10 @@ func (c *client) mainloop(params *LookupParams) {
if _, ok := sentEntries[k]; ok {
continue
}
// Require at least one resolved IP address for ServiceEntry
if e.AddrIPv4 == nil && e.AddrIPv6 == nil {
continue
}
params.Entries <- e
sentEntries[k] = e
}
Expand Down

0 comments on commit 5fa27e2

Please sign in to comment.