mirror of
https://github.com/aria2/aria2.git
synced 2025-03-09 00:51:01 +00:00

Fixed the bug that the control file(.aria2 file) is not renamed according to tryAutoFileRenaming(). tryAutoFileRenaming() was rewritten so that if both renamed file and its control file exist, use them and continue download. The old implementation didn't take into account of control file's existence, so basically you couldn't continue download of renamed file. * src/BtProgressInfoFile.h * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/NullProgressInfoFile.h * src/RequestGroup.cc * test/DefaultBtProgressInfoFileTest.cc * test/MockBtProgressInfoFile.h
39 lines
700 B
C++
39 lines
700 B
C++
#ifndef _D_MOCK_BT_PROGRESS_INFO_FILE_H_
|
|
#define _D_MOCK_BT_PROGRESS_INFO_FILE_H_
|
|
|
|
#include "BtProgressInfoFile.h"
|
|
|
|
namespace aria2 {
|
|
|
|
class MockBtProgressInfoFile : public BtProgressInfoFile {
|
|
private:
|
|
std::string filename;
|
|
public:
|
|
MockBtProgressInfoFile() {}
|
|
virtual ~MockBtProgressInfoFile() {}
|
|
|
|
virtual std::string getFilename() {
|
|
return filename;
|
|
}
|
|
|
|
virtual void setFilename(const std::string& filename) {
|
|
this->filename = filename;
|
|
}
|
|
|
|
virtual bool exists() {
|
|
return false;
|
|
}
|
|
|
|
virtual void save() {}
|
|
|
|
virtual void load() {}
|
|
|
|
virtual void removeFile() {}
|
|
|
|
virtual void updateFilename() {}
|
|
};
|
|
|
|
} // namespace aria2
|
|
|
|
#endif // _D_MOCK_BT_PROGRESS_INFO_FILE_H_
|