Changed nodeLink to setupLink

This commit is contained in:
Milos Gajdos 2019-08-15 19:24:24 +01:00
parent f120452d28
commit 67215ae5da
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -141,7 +141,7 @@ func (t *tun) monitor() {
for _, node := range t.options.Nodes {
t.Lock()
if _, ok := t.links[node]; !ok {
link, err := t.nodeLink(node)
link, err := t.setupLink(node)
if err != nil {
log.Debugf("Tunnel failed to establish node link to %s: %v", node, err)
continue
@ -365,9 +365,9 @@ func (t *tun) keepalive(link *link) {
}
}
// nodeLink attempts to connect to node and returns link if successful
// it returns error if the link failed to be established
func (t *tun) nodeLink(node string) (*link, error) {
// setupLink connects to node and returns link if successful
// It returns error if the link failed to be established
func (t *tun) setupLink(node string) (*link, error) {
log.Debugf("Tunnel dialing %s", node)
c, err := t.options.Transport.Dial(node)
if err != nil {
@ -454,7 +454,7 @@ func (t *tun) connect() error {
}
// connect to node and return link
link, err := t.nodeLink(node)
link, err := t.setupLink(node)
if err != nil {
log.Debugf("Tunnel failed to establish node link to %s: %v", node, err)
continue