From 94da2870e150593178b9387fefa99f6f8833936d Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 9 Mar 2026 07:14:15 -0400 Subject: [PATCH] Apply suggested fix to src/video/api_detection.c from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/video/api_detection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/api_detection.c b/src/video/api_detection.c index 748c7c88..2421d3ea 100644 --- a/src/video/api_detection.c +++ b/src/video/api_detection.c @@ -31,6 +31,9 @@ static pthread_mutex_t curl_mutex = PTHREAD_MUTEX_INITIALIZER; // Default JPEG quality used for API detection snapshots (range typically 0–100). #define API_DETECTION_JPEG_QUALITY_DEFAULT 85 +// Timeout (in seconds) for API detection HTTP requests. +#define API_DETECTION_TIMEOUT_SECONDS 10L + // Maximum number of bytes to log from the API response, including the null terminator. #define API_DETECTION_RESPONSE_PREVIEW_LEN 64 @@ -832,7 +835,7 @@ int detect_objects_api_snapshot(const char *api_url, const char *stream_name, curl_easy_setopt(local_curl, CURLOPT_WRITEFUNCTION, write_memory_callback); curl_easy_setopt(local_curl, CURLOPT_WRITEDATA, (void *)&chunk); - curl_easy_setopt(local_curl, CURLOPT_TIMEOUT, 10); + curl_easy_setopt(local_curl, CURLOPT_TIMEOUT, API_DETECTION_TIMEOUT_SECONDS); setup_common_curl_options(local_curl); // Perform the request