Commit 630b9f87 authored by ginuerzh's avatar ginuerzh

fix test

parent 7686a4bd
...@@ -256,7 +256,10 @@ func (c *Chain) selectRoute() (route *Chain, err error) { ...@@ -256,7 +256,10 @@ func (c *Chain) selectRoute() (route *Chain, err error) {
// selectRouteFor selects route with bypass testing. // selectRouteFor selects route with bypass testing.
func (c *Chain) selectRouteFor(addr string) (route *Chain, err error) { 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 return c, nil
} }
......
...@@ -2,6 +2,7 @@ package gost ...@@ -2,6 +2,7 @@ package gost
import ( import (
"errors" "errors"
"fmt"
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
...@@ -140,6 +141,10 @@ func (node *Node) GetInt(key string) int { ...@@ -140,6 +141,10 @@ func (node *Node) GetInt(key string) int {
} }
func (node Node) String() string { 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() return node.url.String()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment