mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-31 06:10:45 +00:00
refactor(userspace/falco): support zlib and custom threadiness in webserver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -15,6 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
#include "webserver.h"
|
||||
#include "falco_utils.h"
|
||||
#include <atomic>
|
||||
|
||||
falco_webserver::~falco_webserver()
|
||||
@@ -46,6 +47,10 @@ void falco_webserver::start(
|
||||
m_server = new httplib::Server();
|
||||
}
|
||||
|
||||
// configure server
|
||||
auto threadiness = std::min(2u, falco::utils::hardware_concurrency());
|
||||
m_server->new_task_queue = [&threadiness] { return new httplib::ThreadPool(threadiness); };
|
||||
|
||||
// setup healthz endpoint
|
||||
m_server->Get(healthz_endpoint,
|
||||
[](const httplib::Request &, httplib::Response &res) {
|
||||
|
@@ -16,6 +16,7 @@ limitations under the License.
|
||||
#pragma once
|
||||
|
||||
#define CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
#define CPPHTTPLIB_ZLIB_SUPPORT
|
||||
#include <httplib.h>
|
||||
#include <thread>
|
||||
#include "configuration.h"
|
||||
|
Reference in New Issue
Block a user