mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-10 09:09:24 -04:00
remove temporary file when cancel file transfer
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@859 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9f727e2d94
commit
3453604c4d
@ -698,9 +698,28 @@ bool ftController::FileCancel(std::string hash)
|
|||||||
fc->mCreator = NULL;
|
fc->mCreator = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fc->mState = ftFileControl::ERROR_COMPLETION;
|
/* delete the temporary file */
|
||||||
|
if (0 == remove(fc->mCurrentPath.c_str()))
|
||||||
|
{
|
||||||
|
#ifdef CONTROL_DEBUG
|
||||||
|
std::cerr << "ftController::FileCancel() remove temporary file ";
|
||||||
|
std::cerr << fc->mCurrentPath;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef CONTROL_DEBUG
|
||||||
|
std::cerr << "ftController::FileCancel() fail to remove file ";
|
||||||
|
std::cerr << fc->mCurrentPath;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//fc->mState = ftFileControl::ERROR_COMPLETION;
|
||||||
mDownloads.erase(mit);
|
mDownloads.erase(mit);
|
||||||
|
|
||||||
|
IndicateConfigChanged(); /* completed transfer -> save */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user