allow torrents sharing files as long as they're both opened in read-only mode

This commit is contained in:
Arvid Norberg 2009-01-25 01:58:49 +00:00
parent fd8a07ac15
commit 9888ab62d6
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ namespace libtorrent
lru_file_entry e = *i;
e.last_use = time_now();
if (e.key != st)
if (e.key != st && ((e.mode & file::rw_mask) != file::read_only
|| (m & file::rw_mask) != file::read_only))
{
// this means that another instance of the storage
// is using the exact same file.