mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-26 22:00:27 +08:00
fix recv err in win
This commit is contained in:
2
go.mod
2
go.mod
@@ -6,7 +6,7 @@ require (
|
|||||||
github.com/fumiama/go-base16384 v1.2.1
|
github.com/fumiama/go-base16384 v1.2.1
|
||||||
github.com/fumiama/go-x25519 v1.0.0
|
github.com/fumiama/go-x25519 v1.0.0
|
||||||
github.com/fumiama/gofastTEA v0.0.6
|
github.com/fumiama/gofastTEA v0.0.6
|
||||||
github.com/fumiama/water v0.0.0-20211229155341-82646596a427
|
github.com/fumiama/water v0.0.0-20211230051437-3d685121087a
|
||||||
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
|
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||||
|
|||||||
2
go.sum
2
go.sum
@@ -12,6 +12,8 @@ github.com/fumiama/gofastTEA v0.0.6 h1:Yni3MXDbJVa/c4CecgdZDgCJK+fLdvGph+OBqY2mt
|
|||||||
github.com/fumiama/gofastTEA v0.0.6/go.mod h1:+sBZ05nCA2skZkursHNvyr8kULlEetrYTM2y5kA4rQc=
|
github.com/fumiama/gofastTEA v0.0.6/go.mod h1:+sBZ05nCA2skZkursHNvyr8kULlEetrYTM2y5kA4rQc=
|
||||||
github.com/fumiama/water v0.0.0-20211229155341-82646596a427 h1:6T/Y1o2wrNzJKjhjOsCVkKJwIlU8jfUBfRYFYQ9r3Uc=
|
github.com/fumiama/water v0.0.0-20211229155341-82646596a427 h1:6T/Y1o2wrNzJKjhjOsCVkKJwIlU8jfUBfRYFYQ9r3Uc=
|
||||||
github.com/fumiama/water v0.0.0-20211229155341-82646596a427/go.mod h1:BBnNY9PwK+UUn4trAU+H0qsMEypm7+3Bj1bVFuJItlo=
|
github.com/fumiama/water v0.0.0-20211229155341-82646596a427/go.mod h1:BBnNY9PwK+UUn4trAU+H0qsMEypm7+3Bj1bVFuJItlo=
|
||||||
|
github.com/fumiama/water v0.0.0-20211230051437-3d685121087a h1:jVm9uuodbGiBqJzPEHSpYjdFZQ+B9SwBrpXCffr90GY=
|
||||||
|
github.com/fumiama/water v0.0.0-20211230051437-3d685121087a/go.mod h1:BBnNY9PwK+UUn4trAU+H0qsMEypm7+3Bj1bVFuJItlo=
|
||||||
github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0 h1:WfrSFlIlCAtg6Rt2IGna0HhJYSDE45YVHiYqO4wwsEw=
|
github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0 h1:WfrSFlIlCAtg6Rt2IGna0HhJYSDE45YVHiYqO4wwsEw=
|
||||||
github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0/go.mod h1:dPOG7Af/ArO62RgBz2JJTNFByBn/IXWLo/1kZKcLSe8=
|
github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0/go.mod h1:dPOG7Af/ArO62RgBz2JJTNFByBn/IXWLo/1kZKcLSe8=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
|||||||
@@ -60,11 +60,12 @@ func (m *Me) listen() (conn *net.UDPConn, err error) {
|
|||||||
logrus.Infoln("[link] recv query")
|
logrus.Infoln("[link] recv query")
|
||||||
p.onQuery(&packet)
|
p.onQuery(&packet)
|
||||||
case head.ProtoData:
|
case head.ProtoData:
|
||||||
logrus.Infoln("[link] deliver to", p.peerip)
|
|
||||||
if p.pipe != nil {
|
if p.pipe != nil {
|
||||||
p.pipe <- &packet
|
p.pipe <- &packet
|
||||||
|
logrus.Infoln("[link] deliver to pipe of", p.peerip)
|
||||||
} else {
|
} else {
|
||||||
m.pipe <- &packet
|
m.pipe <- &packet
|
||||||
|
logrus.Infoln("[link] deliver to pipe of me")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ func (nc *NIC) Start(m *link.Me) {
|
|||||||
go func() { // 接收到 NIC
|
go func() { // 接收到 NIC
|
||||||
for nc.hasstart {
|
for nc.hasstart {
|
||||||
packet := m.Read()
|
packet := m.Read()
|
||||||
_, err := nc.ifce.Write(packet.Data)
|
n, err := nc.ifce.Write(packet.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorln("[lower] recv write to nic err:", err)
|
logrus.Errorln("[lower] recv write to nic err:", err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
logrus.Infoln("[lower] recv write", len(packet.Data), "bytes packet to nic")
|
logrus.Infoln("[lower] recv write", n, "bytes packet to nic")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
buf := make([]byte, 4096)
|
buf := make([]byte, 4096)
|
||||||
|
|||||||
Reference in New Issue
Block a user