mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-08 21:04:26 +00:00
Web UI shutdown fix.
This commit is contained in:
parent
669d5a12a2
commit
368ae43849
@ -277,9 +277,20 @@ void HttpConnection::respond() {
|
|||||||
}
|
}
|
||||||
if (list[0] == "command") {
|
if (list[0] == "command") {
|
||||||
const QString& command = list[1];
|
const QString& command = list[1];
|
||||||
respondCommand(command);
|
if (command == "shutdown") {
|
||||||
m_generator.setStatusLine(200, "OK");
|
qDebug() << "Shutdown request from Web UI";
|
||||||
write();
|
// Special case handling for shutdown, we
|
||||||
|
// need to reply to the Web UI before
|
||||||
|
// actually shutting down.
|
||||||
|
m_generator.setStatusLine(200, "OK");
|
||||||
|
write();
|
||||||
|
// Exit application
|
||||||
|
qApp->exit();
|
||||||
|
} else {
|
||||||
|
respondCommand(command);
|
||||||
|
m_generator.setStatusLine(200, "OK");
|
||||||
|
write();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -595,10 +606,6 @@ void HttpConnection::respondCommand(const QString& command) {
|
|||||||
QBtSession::instance()->recheckTorrent(m_parser.post("hash"));
|
QBtSession::instance()->recheckTorrent(m_parser.post("hash"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (command == "shutdown") {
|
|
||||||
qDebug() << "Shutdown request from Web UI";
|
|
||||||
qApp->exit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpConnection::decreaseTorrentsPriority(const QStringList &hashes) {
|
void HttpConnection::decreaseTorrentsPriority(const QStringList &hashes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user