From e00c42434122bad3baeed2a4d14522412a994b86 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 22 May 2016 19:39:14 +0200 Subject: [PATCH] Fix dead lock in buffered writer --- common/io/buffered_writer.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/io/buffered_writer.go b/common/io/buffered_writer.go index c9849675..a64e12d0 100644 --- a/common/io/buffered_writer.go +++ b/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 }