~egtann/lanhttp

cee9e049591c915cbfdbc2b54b4e4e43486965be — Evan Tann 1 year, 2 months ago 16c0415
fix round robin bug
1 files changed, 3 insertions(+), 3 deletions(-)

M lanhttp.go
M lanhttp.go => lanhttp.go +3 -3
@@ 35,7 35,7 @@ type Logger interface{ Printf(string, ...interface{}) }

type Routes map[string][]string

type backends map[string]backend
type backends map[string]*backend

type backend struct {
	IPs   []string


@@ 166,9 166,9 @@ func (c *Client) changeRoutes(new Routes) {
	c.mu.Lock()
	defer c.mu.Unlock()

	backends := map[string]backend{}
	backends := map[string]*backend{}
	for k, ips := range new {
		backends[k] = backend{IPs: ips}
		backends[k] = &backend{IPs: ips}
	}
	c.backends = backends
}