Some dfu implementations misbehave if a DFUDNLOAD (apart from the last one) doesn't match the full transfer size as declared by the functional descriptor.
The current usage of a BufReader doesn't guarantee this as the underlying reader may not fully fill the buffer; This is uncommon/unlikely when reading from a local filesystem, but very likely when reading from a network stream.
Introduce a simple helper buffer which fully refills it's buffer from the underlying reader, but otherwise matches the use api from bufreader to get the intended semantics.
Some dfu implementations misbehave if a DFUDNLOAD (apart from the last one) doesn't match the full transfer size as declared by the functional descriptor.
The current usage of a BufReader doesn't guarantee this as the underlying reader may not fully fill the buffer; This is uncommon/unlikely when reading from a local filesystem, but very likely when reading from a network stream.
Introduce a simple helper buffer which fully refills it's buffer from the underlying reader, but otherwise matches the use api from bufreader to get the intended semantics.
Signed-off-by: Sjoerd Simons sjoerd@collabora.com