Fixing the tunnel loopback messaging

This commit is contained in:
Milos Gajdos
2019-08-14 17:14:39 +01:00
parent 8f0c2e0412
commit f9eddf1e6f
2 changed files with 28 additions and 10 deletions

View File

@@ -25,6 +25,8 @@ type socket struct {
recv chan *message
// wait until we have a connection
wait chan bool
// outbound marks the socket as outbound
outbound bool
}
// message is sent over the send channel
@@ -33,6 +35,8 @@ type message struct {
id string
// the session id
session string
// outbound marks the message as outbound
outbound bool
// transport data
data *transport.Message
}
@@ -72,7 +76,12 @@ func (s *socket) Send(m *transport.Message) error {
}
// append to backlog
msg := &message{id: s.id, session: s.session, data: data}
msg := &message{
id: s.id,
session: s.session,
outbound: s.outbound,
data: data,
}
log.Debugf("Appending %+v to send backlog", msg)
s.send <- msg
return nil