返回某个torrent实际写入内存的字节数

This commit is contained in:
whr819987540 2023-05-04 17:26:14 +08:00
parent 30e909f905
commit 90b694c4ae
1 changed files with 8 additions and 0 deletions

View File

@ -2568,3 +2568,11 @@ func (t *Torrent) checkValidReceiveChunk(r Request) error {
// catch most of the overflow manipulation stuff by checking index and begin above.
return nil
}
func (t *Torrent) BytesWrittenToMemory() int64 {
ci := t.storageOpener.Ci()
if value, ok := ci.(storage.MemoryClientImpl); ok {
return value.BytesWrittenToMemory()
}
return 0
}