mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
handle the scheme correctly in config.Bind
This commit is contained in:
parent
359fc190bd
commit
3d1538d53c
2 changed files with 9 additions and 6 deletions
|
|
@ -19,7 +19,6 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -154,10 +153,12 @@ func NewGossipMemberSetWithTransport(name string, cfg *pilosa.Config, transport
|
|||
}
|
||||
|
||||
port := transport.Net.GetAutoBindPort()
|
||||
host, _, err := net.SplitHostPort(cfg.Bind)
|
||||
|
||||
bindURI, err := pilosa.NewURIFromAddress(cfg.Bind)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("split host port: %s", err)
|
||||
return nil, fmt.Errorf("getting uri from bind address (with transport): %s", err)
|
||||
}
|
||||
host := bindURI.Host()
|
||||
|
||||
var gossipKey []byte
|
||||
if cfg.Gossip.Key != "" {
|
||||
|
|
@ -210,10 +211,12 @@ func NewGossipMemberSet(name string, cfg *pilosa.Config, server *pilosa.Server)
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("convert port: %s", err)
|
||||
}
|
||||
host, _, err := net.SplitHostPort(cfg.Bind)
|
||||
|
||||
bindURI, err := pilosa.NewURIFromAddress(cfg.Bind)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("split host port: %s", err)
|
||||
return nil, fmt.Errorf("getting uri from bind address: %s", err)
|
||||
}
|
||||
host := bindURI.Host()
|
||||
|
||||
// Set up the transport.
|
||||
transport, err := NewTransport(host, port)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ func NewMain() *Main {
|
|||
m := &Main{Command: server.NewCommand(os.Stdin, os.Stdout, os.Stderr)}
|
||||
m.Server.Network = *Network
|
||||
m.Config.DataDir = path
|
||||
m.Config.Bind = "localhost:0"
|
||||
m.Config.Bind = "http://localhost:0"
|
||||
m.Config.Cluster.Disabled = true
|
||||
m.Command.Stdin = &m.Stdin
|
||||
m.Command.Stdout = &m.Stdout
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue