1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-03 07:56:42 -05:00

fix mb copy again

This commit is contained in:
Darien Raymond 2018-07-29 03:23:59 +02:00
parent e0a2247a07
commit 9ee9af9e02
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -392,21 +392,21 @@ func (c *Connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
} }
}() }()
mbPtr := &mb
for { for {
for { for {
if c == nil || c.State() != StateActive { if c == nil || c.State() != StateActive {
return io.ErrClosedPipe return io.ErrClosedPipe
} }
mbPtr := &mb
if !c.sendingWorker.Push(func(bb []byte) (int, error) { if !c.sendingWorker.Push(func(bb []byte) (int, error) {
return mbPtr.Read(bb[:c.mss]) return mbPtr.Read(bb[:c.mss])
}) { }) {
break break
} }
updatePending = true updatePending = true
if mb.IsEmpty() { if mbPtr.IsEmpty() {
return nil return nil
} }
} }