浏览代码

flush when buffer is large enough

Tao Wen 8 年之前
父节点
当前提交
dcb78991c4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      feature_stream.go

+ 1 - 1
feature_stream.go

@@ -164,7 +164,7 @@ func (b *Stream) Flush() error {
 func (b *Stream) ensure(minimal int) {
 	available := b.Available()
 	if available < minimal {
-		if available < 128 {
+		if b.n > 1024 {
 			b.Flush()
 		}
 		b.growAtLeast(minimal)