Browse Source

Web UI shutdown fix.

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
368ae43849
  1. 21
      src/webui/httpconnection.cpp

21
src/webui/httpconnection.cpp

@ -277,9 +277,20 @@ void HttpConnection::respond() { @@ -277,9 +277,20 @@ void HttpConnection::respond() {
}
if (list[0] == "command") {
const QString& command = list[1];
respondCommand(command);
m_generator.setStatusLine(200, "OK");
write();
if (command == "shutdown") {
qDebug() << "Shutdown request from Web UI";
// 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;
}
}
@ -595,10 +606,6 @@ void HttpConnection::respondCommand(const QString& command) { @@ -595,10 +606,6 @@ void HttpConnection::respondCommand(const QString& command) {
QBtSession::instance()->recheckTorrent(m_parser.post("hash"));
return;
}
if (command == "shutdown") {
qDebug() << "Shutdown request from Web UI";
qApp->exit();
}
}
void HttpConnection::decreaseTorrentsPriority(const QStringList &hashes) {

Loading…
Cancel
Save