From 41bd0416bd0b5353dcd30ec98c9993df325c3921 Mon Sep 17 00:00:00 2001 From: Carl Mueller-Roemer Date: Mon, 15 Mar 2021 23:32:30 +0100 Subject: [PATCH] Add finite timeout on CURL metrics endpoint. (#22) Prevent CURL hanging up without timeout when connection can't be established. Creating a deadlock on the filesystem when executed behind a proxy. --- src/vcpkg/metrics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vcpkg/metrics.cpp b/src/vcpkg/metrics.cpp index e0a4e5017e..a5192b3c29 100644 --- a/src/vcpkg/metrics.cpp +++ b/src/vcpkg/metrics.cpp @@ -483,6 +483,8 @@ namespace vcpkg::Metrics // TODO: convert to cmd_execute_background or something. auto curl = System::Command("curl") .string_arg("https://dc.services.visualstudio.com/v2/track") + .string_arg("--max-time") + .string_arg("3") .string_arg("-H") .string_arg("Content-Type: application/json") .string_arg("-X")