fix application bug

This commit is contained in:
Jeff
2019-05-13 11:19:18 +08:00
committed by zryfish
parent 996d6fe4c5
commit 5462f51e65
717 changed files with 87703 additions and 53426 deletions

View File

@@ -16,6 +16,7 @@ package proxy
import (
"hash/fnv"
"log"
"math"
"math/rand"
"net"
@@ -139,7 +140,9 @@ func hostByHashing(pool HostPool, s string) *UpstreamHost {
// hash calculates a hash based on string s
func hash(s string) uint32 {
h := fnv.New32a()
h.Write([]byte(s))
if _, err := h.Write([]byte(s)); err != nil {
log.Println("[ERROR] failed to write bytes: ", err)
}
return h.Sum32()
}