fix: set kill_on_drop and explicit stdio pipes so curl doesn't inherit parent fds
This commit is contained in:
parent
79bf7d9295
commit
94200b430f
|
|
@ -178,7 +178,11 @@ async fn run_curl(
|
||||||
.arg("--connect-timeout").arg(format!("{:.1}", timeout_secs))
|
.arg("--connect-timeout").arg(format!("{:.1}", timeout_secs))
|
||||||
.arg("-X").arg(method)
|
.arg("-X").arg(method)
|
||||||
.arg("--user-agent").arg("PingQL-Monitor/0.1")
|
.arg("--user-agent").arg("PingQL-Monitor/0.1")
|
||||||
.arg("--location"); // follow redirects
|
.arg("--location") // follow redirects
|
||||||
|
.stdin(std::process::Stdio::null())
|
||||||
|
.stdout(std::process::Stdio::piped())
|
||||||
|
.stderr(std::process::Stdio::piped())
|
||||||
|
.kill_on_drop(true); // kill if future is dropped
|
||||||
|
|
||||||
if let Some(hdrs) = headers {
|
if let Some(hdrs) = headers {
|
||||||
for (k, v) in hdrs {
|
for (k, v) in hdrs {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue