change: can down not send.
This commit is contained in:
@@ -33,7 +33,7 @@ void FileTrans::fbtReqSend(QSharedPointer<FrameBuffer> frame)
|
|||||||
|
|
||||||
// recv is single thread recv, judge idle
|
// recv is single thread recv, judge idle
|
||||||
if (downTask_.state == TaskState::STATE_RUNNING) {
|
if (downTask_.state == TaskState::STATE_RUNNING) {
|
||||||
info.msg = QString(tr("busy"));
|
info.msg = QString(tr("busy..."));
|
||||||
clientCore_->Send<InfoMsg>(info, FBT_CLI_CANOT_SEND, frame->fid);
|
clientCore_->Send<InfoMsg>(info, FBT_CLI_CANOT_SEND, frame->fid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -99,20 +99,12 @@ void FileTrans::fbtTransDone(QSharedPointer<FrameBuffer> frame)
|
|||||||
qCritical() << QString(tr("recv file:%1 done sigal, but file not opened.")).arg(info.msg);
|
qCritical() << QString(tr("recv file:%1 done sigal, but file not opened.")).arg(info.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the other party indicates that can download, ready to receive the file.
|
||||||
void FileTrans::fbtCanDown(QSharedPointer<FrameBuffer> frame)
|
void FileTrans::fbtCanDown(QSharedPointer<FrameBuffer> frame)
|
||||||
{
|
{
|
||||||
// ready to send
|
// ready to recv file.
|
||||||
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
auto info = infoUnpack<InfoMsg>(frame->data);
|
||||||
auto doTask = QSharedPointer<DoTransTask>::create();
|
qDebug() << QString(tr("start trans file:%1.")).arg(info.fromPath);
|
||||||
doTask->file.setFileName(info.fromPath);
|
|
||||||
if (!doTask->file.open(QIODevice::ReadOnly)) {
|
|
||||||
qCritical() << QString(tr("open file failed: %1")).arg(info.fromPath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
doTask->task.isUpload = true;
|
|
||||||
doTask->task.localPath = "";
|
|
||||||
doTask->task.remoteId = frame->fid;
|
|
||||||
SendFile(doTask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileTrans::fbtCanotDown(QSharedPointer<FrameBuffer> frame)
|
void FileTrans::fbtCanotDown(QSharedPointer<FrameBuffer> frame)
|
||||||
|
|||||||
Reference in New Issue
Block a user