mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
commit
e954835579
3 changed files with 19 additions and 3 deletions
|
@ -101,6 +101,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
server = new QLocalServer(this);
|
server = new QLocalServer(this);
|
||||||
|
server->setSocketOptions(QLocalServer::UserAccessOption);
|
||||||
QString lockName = QDir(QDir::tempPath()).absolutePath()
|
QString lockName = QDir(QDir::tempPath()).absolutePath()
|
||||||
+ QLatin1Char('/') + socketName
|
+ QLatin1Char('/') + socketName
|
||||||
+ QLatin1String("-lockfile");
|
+ QLatin1String("-lockfile");
|
||||||
|
@ -191,6 +192,12 @@ void QtLocalPeer::receiveConnection()
|
||||||
QByteArray uMsg;
|
QByteArray uMsg;
|
||||||
quint32 remaining;
|
quint32 remaining;
|
||||||
ds >> remaining;
|
ds >> remaining;
|
||||||
|
if (remaining > 65535) {
|
||||||
|
// drop suspiciously large data
|
||||||
|
delete socket;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uMsg.resize(remaining);
|
uMsg.resize(remaining);
|
||||||
int got = 0;
|
int got = 0;
|
||||||
char* uMsgBuf = uMsg.data();
|
char* uMsgBuf = uMsg.data();
|
||||||
|
|
|
@ -4316,9 +4316,14 @@ void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert *
|
||||||
// so we remove the directory ourselves
|
// so we remove the directory ourselves
|
||||||
Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove);
|
Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove);
|
||||||
|
|
||||||
LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...")
|
if (p->error) {
|
||||||
.arg(tmpRemovingTorrentData.name, QString::fromLocal8Bit(p->error.message().c_str()))
|
LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...")
|
||||||
, Log::CRITICAL);
|
.arg(tmpRemovingTorrentData.name, QString::fromStdString(p->error.message()))
|
||||||
|
, Log::WARNING);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p)
|
void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p)
|
||||||
|
|
|
@ -1285,6 +1285,8 @@ void TorrentHandle::setSequentialDownload(bool b)
|
||||||
m_nativeHandle.set_sequential_download(b);
|
m_nativeHandle.set_sequential_download(b);
|
||||||
m_nativeStatus.sequential_download = b; // prevent return cached value
|
m_nativeStatus.sequential_download = b; // prevent return cached value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveResumeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandle::toggleSequentialDownload()
|
void TorrentHandle::toggleSequentialDownload()
|
||||||
|
@ -1331,6 +1333,8 @@ void TorrentHandle::setFirstLastPiecePriorityImpl(const bool enabled, const QVec
|
||||||
|
|
||||||
LogMsg(tr("Download first and last piece first: %1, torrent: '%2'")
|
LogMsg(tr("Download first and last piece first: %1, torrent: '%2'")
|
||||||
.arg((enabled ? tr("On") : tr("Off")), name()));
|
.arg((enabled ? tr("On") : tr("Off")), name()));
|
||||||
|
|
||||||
|
saveResumeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandle::toggleFirstLastPiecePriority()
|
void TorrentHandle::toggleFirstLastPiecePriority()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue