Skip to content

Commit

Permalink
Merge pull request #45 from flatcar/kai/keepalive
Browse files Browse the repository at this point in the history
download_sysext: Set TCP keepalive option
  • Loading branch information
pothos authored Dec 22, 2023
2 parents 79c38ef + d864a05 commit 500d6c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/download_sysext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,12 @@ fn main() -> Result<(), Box<dyn Error>> {
fs::create_dir_all(&temp_dir)?;

// The default policy of reqwest Client supports max 10 attempts on HTTP redirect.
let client = Client::builder().connect_timeout(Duration::from_secs(HTTP_CONN_TIMEOUT)).timeout(Duration::from_secs(DOWNLOAD_TIMEOUT)).redirect(Policy::default()).build()?;
let client = Client::builder()
.tcp_keepalive(Duration::from_secs(HTTP_CONN_TIMEOUT))
.connect_timeout(Duration::from_secs(HTTP_CONN_TIMEOUT))
.timeout(Duration::from_secs(DOWNLOAD_TIMEOUT))
.redirect(Policy::default())
.build()?;

// If input_xml exists, simply read it.
// If not, try to read from payload_url.
Expand Down

0 comments on commit 500d6c6

Please sign in to comment.