1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -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 {
if c == nil || c.State() != StateActive {
return io.ErrClosedPipe
}
mbPtr := &mb
if !c.sendingWorker.Push(func(bb []byte) (int, error) {
return mbPtr.Read(bb[:c.mss])
}) {
break
}
updatePending = true
if mb.IsEmpty() {
if mbPtr.IsEmpty() {
return nil
}
}