From b96bde3748412d9d44bc3ea953e40966a20c829e Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Mon, 28 Aug 2023 10:30:58 +0200 Subject: [PATCH] fix(userspace/libsinsp): set a timeout on the curl handle when retrieving docker info. Signed-off-by: Federico Di Pierro --- userspace/libsinsp/container_engine/docker/connection_linux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/userspace/libsinsp/container_engine/docker/connection_linux.cpp b/userspace/libsinsp/container_engine/docker/connection_linux.cpp index fba584d141..8248da95ed 100644 --- a/userspace/libsinsp/container_engine/docker/connection_linux.cpp +++ b/userspace/libsinsp/container_engine/docker/connection_linux.cpp @@ -69,6 +69,7 @@ docker_connection::docker_response docker_connection::get_docker(const docker_lo curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, docker_curl_write_callback); curl_easy_setopt(curl, CURLOPT_UNIX_SOCKET_PATH, docker_path.c_str()); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); std::string url = "http://localhost" + m_api_version + req_url;