feat: parallelize IMAP and SMTP connection attempts (#5915)

Previously for each connection candidate (essentially host and port
pair) after resolving the host to a list of IPs Delta Chat iterated IP
addresses one by one. Now for IMAP and SMTP we try up to 5 IP addresses
in parallel. We start with one connection and add more connections
later. If some connection fails, e.g. we try to connect to IPv6 on IPv4
network and get "Network is unreachable" (ENETUNREACH) error, we replace
failed connection with another one immediately.

Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
link2xt
2024-08-28 22:00:07 +00:00
committed by GitHub
parent 84c1ffd7cc
commit aab8ef2726
4 changed files with 204 additions and 80 deletions

View File

@@ -576,7 +576,7 @@ async fn get_autoconfig(
async fn nicer_configuration_error(context: &Context, e: String) -> String {
if e.to_lowercase().contains("could not resolve")
|| e.to_lowercase().contains("no dns resolution results")
|| e.to_lowercase().contains("connection attempts")
|| e.to_lowercase()
.contains("temporary failure in name resolution")
|| e.to_lowercase().contains("name or service not known")