fix application bug
This commit is contained in:
5
vendor/github.com/mholt/caddy/caddyhttp/proxy/policy.go
generated
vendored
5
vendor/github.com/mholt/caddy/caddyhttp/proxy/policy.go
generated
vendored
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user