feat: sort DNS results by successful connection timestamp (#5818)

This commit is contained in:
link2xt
2024-08-02 16:53:16 +00:00
committed by GitHub
parent 642eaf92d7
commit 094d310f5c
7 changed files with 548 additions and 139 deletions

View File

@@ -955,6 +955,22 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
.await?;
}
inc_and_check(&mut migration_version, 117)?;
if dbversion < migration_version {
sql.execute_migration(
"CREATE TABLE connection_history (
host TEXT NOT NULL, -- server hostname
port INTEGER NOT NULL, -- server port
alpn TEXT NOT NULL, -- ALPN such as smtp or imap
addr TEXT NOT NULL, -- IP address
timestamp INTEGER NOT NULL, -- timestamp of the most recent successful connection
UNIQUE (host, port, alpn, addr)
) STRICT",
migration_version,
)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?