couple bug fixes in tunnel

This commit is contained in:
Asim Aslam 2019-12-03 08:11:36 +00:00
parent 972c0989af
commit 2c0801fc1c
2 changed files with 6 additions and 4 deletions

View File

@ -1060,6 +1060,8 @@ func (n *network) Connect() error {
// send the connect message // send the connect message
n.sendConnect() n.sendConnect()
// most importantly
break
} }
}() }()

View File

@ -354,14 +354,14 @@ func (s *session) Send(m *transport.Message) error {
// Recv is used to receive a message // Recv is used to receive a message
func (s *session) Recv(m *transport.Message) error { func (s *session) Recv(m *transport.Message) error {
var msg *message
select { select {
case <-s.closed: case <-s.closed:
return errors.New("session is closed") return errors.New("session is closed")
default:
// no op
}
// recv from backlog // recv from backlog
msg := <-s.recv case msg = <-s.recv:
}
// check the error if one exists // check the error if one exists
select { select {