mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-30 08:32:12 +00:00
feat(outputs_http): implement support for compressed upload
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
parent
ab0133d1dd
commit
691bc8b04d
@ -566,6 +566,7 @@ http_output:
|
|||||||
client_key: "/etc/ssl/certs/client.key"
|
client_key: "/etc/ssl/certs/client.key"
|
||||||
# Whether to echo server answers to stdout
|
# Whether to echo server answers to stdout
|
||||||
echo: false
|
echo: false
|
||||||
|
compress_uploads: false
|
||||||
|
|
||||||
# [Stable] `program_output`
|
# [Stable] `program_output`
|
||||||
#
|
#
|
||||||
|
@ -309,6 +309,10 @@ void falco_configuration::load_yaml(const std::string& config_name, const yaml_h
|
|||||||
client_key = config.get_scalar<std::string>("http_output.client_key", "/etc/ssl/certs/client.key");
|
client_key = config.get_scalar<std::string>("http_output.client_key", "/etc/ssl/certs/client.key");
|
||||||
http_output.options["client_key"] = client_key;
|
http_output.options["client_key"] = client_key;
|
||||||
|
|
||||||
|
bool compress_uploads;
|
||||||
|
compress_uploads = config.get_scalar<bool>("http_output.compress_uploads", false);
|
||||||
|
http_output.options["compress_uploads"] = compress_uploads? std::string("true") : std::string("false");
|
||||||
|
|
||||||
m_outputs.push_back(http_output);
|
m_outputs.push_back(http_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,11 @@ bool falco::outputs::output_http::init(const config& oc, bool buffered, const st
|
|||||||
CHECK_RES(curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, noop_write_callback));
|
CHECK_RES(curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, noop_write_callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m_oc.options["compress_uploads"] == std::string("true"))
|
||||||
|
{
|
||||||
|
CHECK_RES(curl_easy_setopt(m_curl, CURLOPT_TRANSFER_ENCODING, 1L));
|
||||||
|
}
|
||||||
|
|
||||||
if(res != CURLE_OK)
|
if(res != CURLE_OK)
|
||||||
{
|
{
|
||||||
err = "libcurl error: " + std::string(curl_easy_strerror(res));
|
err = "libcurl error: " + std::string(curl_easy_strerror(res));
|
||||||
|
Loading…
Reference in New Issue
Block a user