Here is my problem: I am sandboxing RetroShare (using Sandboxie). I have observed that files, which are downloaded by my friends, are always duplicated in the Sandbox. This can only happen if RetroShare opens these files in write-mode.
I have searched for the code, which is responsible for this behavior, and I have found it in ftfilecreator.cc. As it seems, RetroShare always tries to open the served files in read/write-mode first. The read-only mode servers as a fallback.
I have prepared a patch which changes the behavior such that the files are always opened in read-only mode.
changes the behavior such that the files are always opened in read-only mode
Problem is: ftFileProvider shared the file descriptor with its subclass ftFileCreator. So sometimes it needs to open it in R/W because the file is being written by ftFileCreator while being swarmed by ftFileProvider.
Why is this an issue btw?