forked from qt-creator/qt-creator
Fix 'SFTP upload hangs' issue with Dropbear
This happens at least on Boot2Qt devices with Dropbear SSH. Handling readChannelFinished() signal fixes the issue. Task-number: QTCREATORBUG-16158 Change-Id: I7c6660ce3a1bfe6eeb868da5a818c0b92307eda0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Eike Ziller
parent
a8230eb6c1
commit
b76af11d80
@@ -191,6 +191,8 @@ void GenericDirectUploadService::handleUploadFinished(SftpJobId jobId, const QSt
|
||||
this, &GenericDirectUploadService::handleStdOutData);
|
||||
connect(d->chmodProc.data(), &SshRemoteProcess::readyReadStandardError,
|
||||
this, &GenericDirectUploadService::handleStdErrData);
|
||||
connect(d->chmodProc.data(), &SshRemoteProcess::readChannelFinished,
|
||||
this, &GenericDirectUploadService::handleReadChannelFinished);
|
||||
d->chmodProc->start();
|
||||
} else {
|
||||
uploadNextFile();
|
||||
@@ -275,6 +277,8 @@ void GenericDirectUploadService::handleMkdirFinished(int exitStatus)
|
||||
this, &GenericDirectUploadService::handleStdOutData);
|
||||
connect(d->lnProc.data(), &SshRemoteProcess::readyReadStandardError,
|
||||
this, &GenericDirectUploadService::handleStdErrData);
|
||||
connect(d->lnProc.data(), &SshRemoteProcess::readChannelFinished,
|
||||
this, &GenericDirectUploadService::handleReadChannelFinished);
|
||||
d->lnProc->start();
|
||||
} else {
|
||||
const SftpJobId job = d->uploader->uploadFile(df.localFilePath().toString(),
|
||||
@@ -310,6 +314,13 @@ void GenericDirectUploadService::handleStdErrData()
|
||||
emit stdErrData(QString::fromUtf8(process->readAllStandardError()));
|
||||
}
|
||||
|
||||
void GenericDirectUploadService::handleReadChannelFinished()
|
||||
{
|
||||
SshRemoteProcess * const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
if (process && process->atEnd())
|
||||
process->close();
|
||||
}
|
||||
|
||||
void GenericDirectUploadService::stopDeployment()
|
||||
{
|
||||
QTC_ASSERT(d->state == InitializingSftp || d->state == Uploading, setFinished(); return);
|
||||
@@ -383,6 +394,8 @@ void GenericDirectUploadService::uploadNextFile()
|
||||
this, &GenericDirectUploadService::handleStdOutData);
|
||||
connect(d->mkdirProc.data(), &SshRemoteProcess::readyReadStandardError,
|
||||
this, &GenericDirectUploadService::handleStdErrData);
|
||||
connect(d->mkdirProc.data(), &SshRemoteProcess::readChannelFinished,
|
||||
this, &GenericDirectUploadService::handleReadChannelFinished);
|
||||
emit progressMessage(tr("Uploading file \"%1\"...")
|
||||
.arg(df.localFilePath().toUserOutput()));
|
||||
d->mkdirProc->start();
|
||||
|
@@ -68,6 +68,7 @@ private:
|
||||
void handleChmodFinished(int exitStatus);
|
||||
void handleStdOutData();
|
||||
void handleStdErrData();
|
||||
void handleReadChannelFinished();
|
||||
|
||||
void checkDeploymentNeeded(const ProjectExplorer::DeployableFile &file) const;
|
||||
void setFinished();
|
||||
|
Reference in New Issue
Block a user