The function is called inside `ranch_transport:sendfile/8` in the after clause of the try. In the tests I check that `{ok, Initial} = file:position(RawFile, {cur, 0})` in the `rawfile_range_{medium/large/small}/1` tests. This means that the file position has been reset by `sendfile_after/2`.