get_response: print process stderr as warnings

This commit is contained in:
dece 2021-11-24 18:17:53 +01:00
parent 237959fb42
commit badc42a7e2

View file

@ -11,7 +11,7 @@ use std::thread;
extern crate clap;
use chrono::offset::TimeZone;
use log::{debug, error, info};
use log::{debug, error, info, warn};
use openssl::{asn1, ssl, x509};
/// General CGI configuration.
@ -346,6 +346,17 @@ fn get_response(
cgi_error.to_owned()
})?;
if output.stderr.len() > 0 {
warn!("Process standard error:");
if let Ok(stderr) = std::str::from_utf8(output.stderr.as_slice()) {
for line in stderr.lines() {
warn!(" {}", line);
}
} else {
error!("Can't decode process standard error.")
}
}
Ok((url_str.to_string(), output.stdout))
}