mirror of
https://github.com/xtaci/kcp-go.git
synced 2024-04-21 12:32:15 +00:00
bug fix
This commit is contained in:
@@ -104,8 +104,9 @@ type (
|
||||
nonce Entropy
|
||||
|
||||
// packets waiting to be sent on wire
|
||||
txqueue []ipv4.Message
|
||||
xconn batchConn // for x/net
|
||||
txqueue []ipv4.Message
|
||||
xconn batchConn // for x/net
|
||||
xconnWriteError error
|
||||
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func (s *UDPSession) tx(txqueue []ipv4.Message) {
|
||||
// default version
|
||||
if s.xconn == nil {
|
||||
if s.xconn == nil || s.xconnWriteError != nil {
|
||||
s.defaultTx(txqueue)
|
||||
return
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func (s *UDPSession) tx(txqueue []ipv4.Message) {
|
||||
if operr, ok := err.(*net.OpError); ok {
|
||||
if se, ok := operr.Err.(*os.SyscallError); ok {
|
||||
if se.Syscall == "sendmmsg" {
|
||||
s.xconn = nil // set s.xconn to nil permanently
|
||||
s.xconnWriteError = se
|
||||
s.defaultTx(txqueue)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user