mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
add http error pages (#381)
* implement 404 for webserver - this is a quick hack, should be refactored later * add http error pages ... design is more a placebo ;-) * tune errorpages fix some cgi related stuff, now only python is possible executing and reading python file is possilbe, but it cannot receive any data from webui * fix typo * fix another typo
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QStringList>
|
||||
#include <string>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <cstdio>
|
||||
@@ -37,21 +38,21 @@ void restartHyperion(bool asNewProcess)
|
||||
Error(log, "error while restarting hyperion");
|
||||
}
|
||||
|
||||
std::string command_exec(const char* cmd)
|
||||
QByteArray command_exec(QString cmd, QByteArray data)
|
||||
{
|
||||
char buffer[128];
|
||||
std::string result = "";
|
||||
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
|
||||
|
||||
std::shared_ptr<FILE> pipe(popen(cmd.toLocal8Bit().constData(), "r"), pclose);
|
||||
if (pipe)
|
||||
{
|
||||
while (!feof(pipe.get()))
|
||||
{
|
||||
if (fgets(buffer, 128, pipe.get()) != NULL)
|
||||
result += buffer;
|
||||
while (!feof(pipe.get()))
|
||||
{
|
||||
if (fgets(buffer, 128, pipe.get()) != NULL)
|
||||
result += buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result.c_str();
|
||||
}
|
||||
|
||||
};
|
Reference in New Issue
Block a user