lib/relay: Prevent spurious relay error message (fixes #5861) (#5864)

This commit is contained in:
Jakob Borg 2019-07-17 10:55:28 +02:00 committed by Simon Frei
parent eed1edcca0
commit e7e177a6fa
2 changed files with 3 additions and 4 deletions

View File

@ -169,8 +169,7 @@ func relayAddressesOrder(input []string) []string {
sort.Ints(ids)
addresses := make([]string, len(input))
addresses := make([]string, 0, len(input))
for _, id := range ids {
addresses = append(addresses, buckets[id]...)
}

View File

@ -145,7 +145,7 @@ func (c *staticClient) URI() *url.URL {
func (c *staticClient) connect() error {
if c.uri.Scheme != "relay" {
return fmt.Errorf("Unsupported relay schema: %v", c.uri.Scheme)
return fmt.Errorf("unsupported relay scheme: %v", c.uri.Scheme)
}
t0 := time.Now()
@ -196,7 +196,7 @@ func (c *staticClient) join() error {
switch msg := message.(type) {
case protocol.Response:
if msg.Code != 0 {
return fmt.Errorf("Incorrect response code %d: %s", msg.Code, msg.Message)
return fmt.Errorf("incorrect response code %d: %s", msg.Code, msg.Message)
}
case protocol.RelayFull: