Write function needs store_buffer
tjjh89017 opened this issue · comments
Date Huang commented
Libtorrent will call async_write and call async_hash immediately (even async_write isn't finished)
So we need to save buf to store_buffer.
async_read/async_hash should read from store_buffer if need.
Currently, we used sync write.
in mmap_disk_io, do_write will erase the store_buffer.
store_buffer will only save storage_idx, piece, offset, buf address.
https://github.com/arvidn/libtorrent/blob/RC_2_0/include/libtorrent/aux_/store_buffer.hpp