fix mb copy again

pull/1524/head^2
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
1 changed files with 3 additions and 3 deletions

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
}
}