mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 07:11:40 +00:00
Merge pull request #70 from yggdrasil-network/urlfix
Default to previous scheme when url.Parse returns an error
This commit is contained in:
commit
cf2e112ae8
@ -313,10 +313,7 @@ func (c *Core) DEBUG_maybeSendUDPKeys(saddr string) {
|
|||||||
|
|
||||||
func (c *Core) DEBUG_addPeer(addr string) {
|
func (c *Core) DEBUG_addPeer(addr string) {
|
||||||
u, err := url.Parse(addr)
|
u, err := url.Parse(addr)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if len(u.Opaque) == 0 {
|
|
||||||
switch strings.ToLower(u.Scheme) {
|
switch strings.ToLower(u.Scheme) {
|
||||||
case "tcp":
|
case "tcp":
|
||||||
c.DEBUG_addTCPConn(u.Host)
|
c.DEBUG_addTCPConn(u.Host)
|
||||||
|
Loading…
Reference in New Issue
Block a user