Flow.write keeps writing until all the data is sent or an error occurs, but sometimes it's useful to perform only a single write operation. For example, if Buf_write asks to write 5 bytes and only 4 get written, we would previously do another 1-byte write. However, there may have been more data available by then.
This is also useful for error recovery, if you need to know exactly how many bytes were successfully written before the error.
Since we're making everyone update their custom sinks anyway, we might as well fix this at the same time.
Note that the Buf_write tests for Read_source_buffer were supposed to test that the target flow read the buffers directly, but since we started using write instead of copy it doesn't matter.
Flow.write
keeps writing until all the data is sent or an error occurs, but sometimes it's useful to perform only a single write operation. For example, ifBuf_write
asks to write 5 bytes and only 4 get written, we would previously do another 1-byte write. However, there may have been more data available by then.This is also useful for error recovery, if you need to know exactly how many bytes were successfully written before the error.
Since we're making everyone update their custom sinks anyway, we might as well fix this at the same time.
Note that the
Buf_write
tests forRead_source_buffer
were supposed to test that the target flow read the buffers directly, but since we started usingwrite
instead ofcopy
it doesn't matter.