etcdserver: determine scheme based on TLSClientConfig

This commit is contained in:
Brian Waldon 2014-09-23 10:10:38 -07:00
parent e19b0442f8
commit 10220335f7

View File

@ -87,11 +87,17 @@ func (ps Peers) Endpoints() []string {
func Sender(t *http.Transport, p Peers) func(msgs []raftpb.Message) {
c := &http.Client{Transport: t}
scheme := "http"
if t.TLSClientConfig != nil {
scheme = "https"
}
return func(msgs []raftpb.Message) {
for _, m := range msgs {
// TODO: reuse go routines
// limit the number of outgoing connections for the same receiver
go send(c, "http", p, m)
go send(c, scheme, p, m)
}
}
}