From bf8eaf56800d1906a4cb9cff25e51a3a8797ee11 Mon Sep 17 00:00:00 2001 From: zty199 <46324746+zty199@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:07:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原始判断条件将 QString 和 bool 类型函数返回值进行比较,可能存在问题 Qt5 中比较结果始终为 false,不会认为安装失败 Log: 判断输出包含 "OMG-IT-GOES-WRONG" 关键词则认为安装失败 --- src/widgets/common/downloaditem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index 5b39962..574780b 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -198,7 +198,7 @@ void DownloadItem::slotAsyncInstall(int t) for (int i = 0; i < everyOut.size(); i++) { tempOutput = everyOut[i]; - if (everyOut[i].left(2) == tempOutput.contains("OMG-IT-GOES-WRONG")) + if (tempOutput.contains("OMG-IT-GOES-WRONG")) { haveError = true; } From 5d29af4dc807b5394c33dd769e997970cf6466da Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 21 Jun 2024 12:57:24 +0800 Subject: [PATCH 2/2] adjust: Now we do not want to enforce weak source to serve. --- src/backend/downloadworker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/downloadworker.cpp b/src/backend/downloadworker.cpp index 881a65b..d7e5f5a 100644 --- a/src/backend/downloadworker.cpp +++ b/src/backend/downloadworker.cpp @@ -120,7 +120,7 @@ void DownloadController::startDownload(const QString &url) QString downloadDir = "/tmp/spark-store/"; //下载目录 QString aria2ConnectionPerServer = "--max-connection-per-server=1"; //每个服务器最大连接数 QString aria2ConnectionMax = "--max-concurrent-downloads=16"; //最大同时下载数 - QString aria2ConnectionTimeout = "--connect-timeout=30"; // 30 秒服务器连接超时 + QString aria2ConnectionTimeout = "--connect-timeout=5"; // 5 秒服务器连接超时 QString aria2MaxRetry = "--max-tries=1"; //设置最大重试次数