mirror of https://github.com/schollz/croc.git
use default port of 9009 if none found #236
This commit is contained in:
parent
85b370291d
commit
c7ba55fc83
|
@ -352,13 +352,11 @@ func (c *Client) Send(options TransferOptions) (err error) {
|
||||||
if address == "" {
|
if address == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
host, port, err := net.SplitHostPort(address)
|
host, port, _ := net.SplitHostPort(address)
|
||||||
if err != nil {
|
log.Debugf("host: '%s', port: '%s'", host, port)
|
||||||
log.Errorf("bad relay address %s", address)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// Default port to :9009
|
// Default port to :9009
|
||||||
if port == "" {
|
if port == "" {
|
||||||
|
host = address
|
||||||
port = "9009"
|
port = "9009"
|
||||||
}
|
}
|
||||||
log.Debugf("got host '%v' and port '%v'", host, port)
|
log.Debugf("got host '%v' and port '%v'", host, port)
|
||||||
|
@ -520,13 +518,10 @@ func (c *Client) Receive() (err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var host, port string
|
var host, port string
|
||||||
host, port, err = net.SplitHostPort(address)
|
host, port, _ = net.SplitHostPort(address)
|
||||||
if err != nil {
|
|
||||||
log.Errorf("bad relay address %s", address)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// Default port to :9009
|
// Default port to :9009
|
||||||
if port == "" {
|
if port == "" {
|
||||||
|
host = address
|
||||||
port = "9009"
|
port = "9009"
|
||||||
}
|
}
|
||||||
log.Debugf("got host '%v' and port '%v'", host, port)
|
log.Debugf("got host '%v' and port '%v'", host, port)
|
||||||
|
|
Loading…
Reference in New Issue