From 951cfaf7e397eef77aaaa0efee741299968cb879 Mon Sep 17 00:00:00 2001 From: ut001910 Date: Mon, 25 Nov 2024 20:08:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8B=E8=BD=BD=E7=A7=BB=E9=99=A4dht?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 下载移除dht文件 Task: https://pms.uniontech.com/task-view-368187.html Log: 下载移除dht文件 --- src/src/aria2/aria2rpcinterface.cpp | 11 ++--------- src/src/ui/mainFrame/mainframe.cpp | 9 --------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/src/aria2/aria2rpcinterface.cpp b/src/src/aria2/aria2rpcinterface.cpp index 2c6e1616..b6bc6e16 100644 --- a/src/src/aria2/aria2rpcinterface.cpp +++ b/src/src/aria2/aria2rpcinterface.cpp @@ -108,15 +108,10 @@ bool Aria2RPCInterface::startUp() *设置aria2c session 路径 时间 input 路径 */ QString sessionCacheFile = QDir::homePath() + "/.cache/uos-aria2c.session"; //session 文件路径 - QString inputFile = QDir::homePath() + "/.cache/uos-aria2c.input"; //.input文件路径 - QString dhtFile = QDir::homePath() + "/.config/uos/downloader/dht.dat"; // - QString dht6File = QDir::homePath() + "/.config/uos/downloader/dht6.dat"; // QString saveSessionInterval = "30"; //秒 qDebug() << "创建session缓存文件: " << sessionCacheFile; QProcess::execute("touch", QStringList() << sessionCacheFile); //创建session缓存文件 - //QProcess::execute("touch", QStringList() << dhtFile); //创建dht文件 - //QProcess::execute("touch", QStringList() << dht6File); //创建dht6文件 QString opt; opt += " --enable-rpc=true"; //启动RPC @@ -147,8 +142,6 @@ bool Aria2RPCInterface::startUp() opt += " --save-session-interval=" + saveSessionInterval; opt += " --enable-dht=true"; //启动dht文件 opt += " --enable-dht6=false"; //禁用dht6文件 - opt += " --dht-file-path=" + dhtFile; - opt += " --dht-file-path6=" + dht6File; opt += " --follow-metalink=false"; if(QSysInfo::currentCpuArchitecture() == "loongarch64"){ opt += " --async-dns=false"; @@ -806,8 +799,8 @@ long Aria2RPCInterface::getCapacityFreeByte(QString path) { QProcess *proc = new QProcess; QStringList opt; - opt << "df " + path; - proc->start("/bin/bash", opt); + opt << path; + proc->start("df", opt); proc->waitForFinished(); QByteArray rt = proc->readAllStandardOutput(); proc->close(); diff --git a/src/src/ui/mainFrame/mainframe.cpp b/src/src/ui/mainFrame/mainframe.cpp index 3474bbc3..e395b5f9 100644 --- a/src/src/ui/mainFrame/mainframe.cpp +++ b/src/src/ui/mainFrame/mainframe.cpp @@ -414,15 +414,6 @@ void MainFrame::updateDHTFile() } QFile::remove(QDir::homePath() + "/.config/uos/downloader/dht.dat"); QFile::remove(QDir::homePath() + "/.config/uos/downloader/dht6.dat"); - - QString dhtpah = QDir::homePath() + "/.config/uos/downloader/"; - static QProcess p; - p.start("curl --connect-timeout 10 -m 20 https://github.com/P3TERX/aria2.conf/raw/master/dht6.dat -o" + dhtpah + "dht6.dat -O"); - p.setStandardOutputFile("/dev/null"); - - static QProcess p2; - p2.start("curl --connect-timeout 10 -m 20 https://github.com/P3TERX/aria2.conf/raw/master/dht.dat -o" + dhtpah + "dht.dat -O"); - p2.setStandardOutputFile("/dev/null"); } void MainFrame::initConnection()