mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
fix: call update_connection_history for proxified connections
This commit is contained in:
@@ -180,6 +180,7 @@ impl Client {
|
||||
Client::connect_insecure_proxy(context, host, port, proxy_config).await?
|
||||
}
|
||||
};
|
||||
update_connection_history(context, "imap", host, port, host, time()).await?;
|
||||
Ok(client)
|
||||
} else {
|
||||
let load_cache = match security {
|
||||
|
||||
@@ -47,6 +47,14 @@ pub(crate) async fn prune_connection_history(context: &Context) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Update the timestamp of the last successfull connection
|
||||
/// to the given `host` and `port`
|
||||
/// with the given application protocol `alpn`.
|
||||
///
|
||||
/// `addr` is the string representation of IP address.
|
||||
/// If connection is made over a proxy which does
|
||||
/// its own DNS resolution,
|
||||
/// `addr` should be the same as `host`.
|
||||
pub(crate) async fn update_connection_history(
|
||||
context: &Context,
|
||||
alpn: &str,
|
||||
|
||||
@@ -168,6 +168,7 @@ async fn connect_stream(
|
||||
connect_insecure_proxy(context, host, port, proxy_config.clone()).await?
|
||||
}
|
||||
};
|
||||
update_connection_history(context, "smtp", host, port, host, time()).await?;
|
||||
Ok(stream)
|
||||
} else {
|
||||
let load_cache = match security {
|
||||
|
||||
Reference in New Issue
Block a user