Merge pull request #843 from milosgajdos83/dead-code

Clean up dead tunnel code
This commit is contained in:
Asim Aslam 2019-10-11 11:15:29 +01:00 committed by GitHub
commit 49fe5d9fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 10 deletions

View File

@ -919,6 +919,7 @@ func (t *tun) Close() error {
default: default:
close(t.closed) close(t.closed)
t.connected = false t.connected = false
}
// send a close message // send a close message
// we don't close the link // we don't close the link
@ -926,9 +927,6 @@ func (t *tun) Close() error {
return t.close() return t.close()
} }
return nil
}
// Dial an address // Dial an address
func (t *tun) Dial(channel string, opts ...DialOption) (Session, error) { func (t *tun) Dial(channel string, opts ...DialOption) (Session, error) {
log.Debugf("Tunnel dialing %s", channel) log.Debugf("Tunnel dialing %s", channel)

View File

@ -98,7 +98,6 @@ func (l *link) Close() error {
return nil return nil
default: default:
close(l.closed) close(l.closed)
return nil
} }
return nil return nil

View File

@ -181,5 +181,4 @@ func (t *tunListener) Accept() (Session, error) {
} }
return c, nil return c, nil
} }
return nil, nil
} }

View File

@ -237,8 +237,6 @@ func (s *session) Send(m *transport.Message) error {
case <-s.closed: case <-s.closed:
return io.EOF return io.EOF
} }
return nil
} }
// Recv is used to receive a message // Recv is used to receive a message