4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-07-09 14:34:06 +00:00

update to latest phony, adjust interface use accordingly

This commit is contained in:
Arceliar
2019-08-27 19:43:54 -05:00
parent 4d9c6342a7
commit 3845f81357
14 changed files with 80 additions and 76 deletions

View File

@ -27,7 +27,7 @@ type tunConn struct {
}
func (s *tunConn) close() {
s.tun.RecvFrom(s, s._close_from_tun)
s.tun.Act(s, s._close_from_tun)
}
func (s *tunConn) _close_from_tun() {
@ -117,7 +117,7 @@ func (s *tunConn) _read(bs []byte) (err error) {
}
func (s *tunConn) writeFrom(from phony.Actor, bs []byte) {
s.RecvFrom(from, func() {
s.Act(from, func() {
s._write(bs)
})
}
@ -197,7 +197,7 @@ func (s *tunConn) _write(bs []byte) (err error) {
// No point in wasting resources to send back an error if there was none
return
}
s.RecvFrom(s.conn, func() {
s.Act(s.conn, func() {
if e, eok := err.(yggdrasil.ConnError); !eok {
if e.Closed() {
s.tun.log.Debugln(s.conn.String(), "TUN/TAP generic write debug:", err)