Explorar el Código

flush when buffer is large enough

Tao Wen hace 8 años
padre
commit
dcb78991c4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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)