Sfoglia il codice sorgente

flush when buffer is large enough

Tao Wen 8 anni fa
parent
commit
dcb78991c4
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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)