@@ -69,7 +69,9 @@ public: | |||||
<<sep | <<sep | ||||
<<content->modifyTime | <<content->modifyTime | ||||
<<sep | <<sep | ||||
<<content->fileType; | |||||
<<content->fileType | |||||
<<sep | |||||
<<FILELIST_SEPARATOR; | |||||
} | } | ||||
}; | }; | ||||
@@ -332,9 +334,11 @@ public: | |||||
break; | break; | ||||
auto content = createFileContent(found, endTask); | auto content = createFileContent(found, endTask); | ||||
content->packetNo = stoul(post->packetNo); | |||||
if (content != nullptr) | if (content != nullptr) | ||||
{ | |||||
content->packetNo = stoul(post->packetNo); | |||||
post->contents.push_back(shared_ptr<Content>(std::move(content))); | post->contents.push_back(shared_ptr<Content>(std::move(content))); | ||||
} | |||||
found = ++endTask; | found = ++endTask; | ||||
} | } | ||||
@@ -610,6 +614,7 @@ bool FeiqEngine::downloadFile(FileTask* task) | |||||
} | } | ||||
fclose(of); | fclose(of); | ||||
task->setProcess(total); | |||||
task->setState(FileTaskState::Finish); | task->setState(FileTaskState::Finish); | ||||
}; | }; | ||||
@@ -22,7 +22,8 @@ void FileTask::setObserver(IFileTaskObserver *observer) | |||||
void FileTask::setProcess(int val) | void FileTask::setProcess(int val) | ||||
{ | { | ||||
mProcess = val; | mProcess = val; | ||||
if (mProcess - mLastProcess >= mNotifySize) | |||||
if (mProcess - mLastProcess >= mNotifySize | |||||
|| mProcess >= mContent->size) | |||||
{ | { | ||||
mLastProcess = mProcess; | mLastProcess = mProcess; | ||||
mObserver->onProgress(this); | mObserver->onProgress(this); | ||||
@@ -129,7 +129,7 @@ | |||||
#define IPMSG_FILE_ALIASFNAME 0x00000040 // alias fname | #define IPMSG_FILE_ALIASFNAME 0x00000040 // alias fname | ||||
#define IPMSG_FILE_UNICODEFNAME 0x00000041 // UNICODE fname | #define IPMSG_FILE_UNICODEFNAME 0x00000041 // UNICODE fname | ||||
#define FILELIST_SEPARATOR 0x7 | |||||
#define FILELIST_SEPARATOR (char)0x7 | |||||
#define HOSTLIST_DUMMY (char)0x8 | #define HOSTLIST_DUMMY (char)0x8 | ||||
#define HLIST_ENTRY_SEPARATOR (char)0x3a | #define HLIST_ENTRY_SEPARATOR (char)0x3a | ||||