Implement IETF protocol

This commit is contained in:
Star Brilliant
2018-03-21 02:01:56 +08:00
parent 64664a59b8
commit 2ab2120a39
3 changed files with 33 additions and 32 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ func (c *Client) handlerFunc(w dns.ResponseWriter, r *dns.Msg, isTCP bool) {
}
numServers := len(c.conf.UpstreamGoogle) + len(c.conf.UpstreamIETF)
random := rand.Intn(numServers)
if random <= len(c.conf.UpstreamGoogle) {
if random < len(c.conf.UpstreamGoogle) {
c.handlerFuncGoogle(w, r, isTCP)
} else {
c.handlerFuncIETF(w, r, isTCP)