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
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
func (s *session) Recv(m *transport.Message) error {
var msg *message
select {
case <-s.closed:
return errors.New("session is closed")
default:
// no op
}
// recv from backlog
msg := <-s.recv
case msg = <-s.recv:
}
// check the error if one exists
select {