Browse Source

修复mac间无法发送文件的问题

master
chenyong 8 years ago
parent
commit
efdce0a5e9
3 changed files with 10 additions and 4 deletions
  1. +7
    -2
      feiqlib/feiqengine.cpp
  2. +2
    -1
      feiqlib/filetask.cpp
  3. +1
    -1
      feiqlib/ipmsg.h

+ 7
- 2
feiqlib/feiqengine.cpp View File

@@ -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);
}; };




+ 2
- 1
feiqlib/filetask.cpp View File

@@ -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);


+ 1
- 1
feiqlib/ipmsg.h View File

@@ -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




Loading…
Cancel
Save