This commit is contained in:
ginuerzh 2018-12-06 20:07:52 +08:00
parent 7686a4bdc8
commit 630b9f87b8
2 changed files with 9 additions and 1 deletions

View File

@ -256,7 +256,10 @@ func (c *Chain) selectRoute() (route *Chain, err error) {
// selectRouteFor selects route with bypass testing.
func (c *Chain) selectRouteFor(addr string) (route *Chain, err error) {
if c.IsEmpty() || c.isRoute {
if c.IsEmpty() {
return newRoute(), nil
}
if c.isRoute {
return c, nil
}

View File

@ -2,6 +2,7 @@ package gost
import (
"errors"
"fmt"
"net/url"
"strconv"
"strings"
@ -140,6 +141,10 @@ func (node *Node) GetInt(key string) int {
}
func (node Node) String() string {
if node.url == nil {
return fmt.Sprintf("%s+%s://%s",
node.Protocol, node.Transport, node.Addr)
}
return node.url.String()
}