浏览代码

Fix dead lock in buffered writer

v2ray 9 年之前
父节点
当前提交
e00c424341
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      common/io/buffered_writer.go

+ 1 - 4
common/io/buffered_writer.go

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