исправил тестовое состояние, исправил логику работы TDMA-морды, мелкие исправления в именовании параметров
This commit is contained in:
25
src/main.cpp
25
src/main.cpp
@@ -28,25 +28,6 @@ constexpr const char* REBOOT_COMMAND = "web-action reboot";
|
||||
constexpr const char* UPGRADE_COMMAND = "web-action upgrade";
|
||||
|
||||
|
||||
static std::vector<char> loadFile(const std::string& path) {
|
||||
std::ifstream is(path, std::ios::in | std::ios::binary);
|
||||
if (!is) {
|
||||
throw std::runtime_error("File not found");
|
||||
}
|
||||
|
||||
std::vector<char> content;
|
||||
for (;;) {
|
||||
char buf[512];
|
||||
auto len = is.read(buf, sizeof(buf)).gcount();
|
||||
if (len <= 0) {
|
||||
break;
|
||||
}
|
||||
content.insert(content.end(), buf, buf + len);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
namespace mime_types = http::server::mime_types;
|
||||
|
||||
void init_logging() {
|
||||
@@ -515,9 +496,9 @@ int main(int argc, char *argv[]) {
|
||||
s->run();
|
||||
|
||||
} else if (strcmp(argv[1], "ssl") == 0) {
|
||||
const auto cert = loadFile("cert.pem");
|
||||
const auto key = loadFile("key.pem");
|
||||
const auto dh = loadFile("dh.pem");
|
||||
std::vector<char> cert; http::resource::loadFile("cert.pem", cert);
|
||||
std::vector<char> key; http::resource::loadFile("key.pem", key);
|
||||
std::vector<char> dh; http::resource::loadFile("dh.pem", dh);
|
||||
|
||||
auto ctx = std::make_shared<ssl::context>(ssl::context::tlsv12);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user