Browse Source

melib/imap: set 9min tcp keepalive on connection

memfd
Manos Pitsidianakis 1 year ago
parent
commit
3b10fa3895
Signed by untrusted user: epilys GPG Key ID: 73627C2F690DF710
  1. 9
      melib/src/backends/imap/connection.rs

9
melib/src/backends/imap/connection.rs

@ -253,6 +253,15 @@ impl ImapStream {
))
.chain_err_kind(crate::error::ErrorKind::Network)?
};
if let Err(err) = stream
.get_ref()
.set_keepalive(Some(Duration::new(60 * 9, 0)))
{
crate::log(
format!("Could not set TCP keepalive in IMAP connection: {}", err),
crate::LoggingLevel::WARN,
);
}
let mut res = String::with_capacity(8 * 1024);
let mut ret = ImapStream {
cmd_id,

Loading…
Cancel
Save