소스 검색

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
 }