Fix dead lock in buffered writer

pull/168/head
v2ray 2016-05-22 19:39:14 +02:00
parent ec610494ea
commit e00c424341
1 changed files with 1 additions and 4 deletions

View File

@ -35,10 +35,7 @@ func (this *BufferedWriter) Write(b []byte) (int, error) {
}
nBytes, _ := this.buffer.Write(b)
if this.buffer.IsFull() {
err := this.Flush()
if err != nil {
return nBytes, err
}
go this.Flush()
}
return nBytes, nil
}