balena-io-modules / blockmap

Tizen's block map format
Apache License 2.0
6 stars 0 forks source link

fix(filter-stream): Prevent emitting too small blocks #22

Closed jhermsmeier closed 7 years ago

jhermsmeier commented 7 years ago

Due to an error in how blocks were chunked, it was possible to emit too small or improperly sized blocks when encountering backpressure buffering.

This fixes that behavior, and ensures that all read buffers are consumed.

jviotti commented 7 years ago

I added some comments about potential edge cases (ignore me if I'm missing something), but otherwise it looks great, and the tests pass :+1: