1
0
Fork 0

Check for more possible errors with peers

https://github.com/rqlite/rqlite/issues/1217
master
Philip O'Toole 1 year ago
parent 92479a4d8c
commit 519df067cc

@ -14,10 +14,12 @@ import (
"io/ioutil"
"log"
"math"
"net"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
"time"
"unsafe"
@ -1793,6 +1795,13 @@ func checkRaftConfiguration(configuration raft.Configuration) error {
if server.Address == "" {
return fmt.Errorf("empty address in configuration: %v", server)
}
if strings.Contains(string(server.Address), "://") {
return fmt.Errorf("protocol specified in address: %v", server.Address)
}
_, _, err := net.SplitHostPort(string(server.Address))
if err != nil {
return fmt.Errorf("invalid address in configuration: %v", server.Address)
}
if idSet[server.ID] {
return fmt.Errorf("found duplicate ID in configuration: %v", server.ID)
}

Loading…
Cancel
Save