This commit is contained in:
xtaci
2019-06-11 15:27:26 +08:00
parent 3a4bcb9bae
commit aba76787a5
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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
View File
@@ -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
}