Registry testing - part 11
This commit is contained in:
@@ -147,7 +147,7 @@ impl DnsLookup for Server {
|
||||
})
|
||||
}
|
||||
})?,
|
||||
HostOrIp::Ip { ip, .. } => vec![ip],
|
||||
HostOrIp::Ip(ip) => vec![ip],
|
||||
};
|
||||
|
||||
if !remote_ips.is_empty() {
|
||||
|
||||
@@ -15,7 +15,7 @@ use common::config::{
|
||||
use mail_auth::IpLookupStrategy;
|
||||
use mail_send::Credentials;
|
||||
use smtp_proto::{Response, Severity};
|
||||
use std::borrow::Cow;
|
||||
use std::{borrow::Cow, net::IpAddr};
|
||||
|
||||
pub mod client;
|
||||
pub mod dane;
|
||||
@@ -247,14 +247,14 @@ impl NextHop<'_> {
|
||||
}
|
||||
}
|
||||
NextHop::Relay(host) => match &host.address {
|
||||
HostOrIp::Host(host) => host.as_str(),
|
||||
HostOrIp::Ip { ip_str, .. } => ip_str.as_str(),
|
||||
HostOrIp::Host(host) => host.as_ref(),
|
||||
HostOrIp::Ip(ip) => ip.ip_str.as_ref(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn fqdn_hostname(&self) -> HostOrIp<Cow<'_, str>> {
|
||||
pub fn fqdn_hostname(&self) -> HostOrIp<Cow<'_, str>, IpAddr> {
|
||||
match self {
|
||||
NextHop::MX { host, .. } => {
|
||||
if !host.ends_with('.') {
|
||||
@@ -264,11 +264,8 @@ impl NextHop<'_> {
|
||||
}
|
||||
}
|
||||
NextHop::Relay(host) => match &host.address {
|
||||
HostOrIp::Host(host) => HostOrIp::Host(host.as_str().into()),
|
||||
HostOrIp::Ip { ip, ip_str } => HostOrIp::Ip {
|
||||
ip: *ip,
|
||||
ip_str: ip_str.as_str().into(),
|
||||
},
|
||||
HostOrIp::Host(host) => HostOrIp::Host(host.as_ref().into()),
|
||||
HostOrIp::Ip(ip) => HostOrIp::Ip(ip.ip),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,14 +34,11 @@ use store::write::{
|
||||
AlignedBytes, Archive, Archiver, BatchBuilder, BlobLink, BlobOp, MergeResult, Params,
|
||||
QueueClass, RegistryClass, ValueClass, now,
|
||||
};
|
||||
use store::{
|
||||
Deserialize, IterateParams, Serialize, SerializeInfallible, U64_LEN, ValueKey, xxhash_rust,
|
||||
};
|
||||
use store::{Deserialize, IterateParams, Serialize, SerializeInfallible, U64_LEN, ValueKey};
|
||||
use trc::{AddContext, ServerEvent, SpamEvent};
|
||||
use types::blob::BlobId;
|
||||
use types::blob_hash::BlobHash;
|
||||
use utils::DomainPart;
|
||||
use utils::snowflake::SnowflakeIdGenerator;
|
||||
|
||||
pub const LOCK_EXPIRY: u64 = 10 * 60; // 10 minutes
|
||||
pub const QUEUE_REFRESH: u64 = 5 * 60; // 5 minutes
|
||||
@@ -476,10 +473,7 @@ impl MessageWrapper {
|
||||
.to_pickled_vec();
|
||||
|
||||
let object_id = ObjectType::SpamTrainingSample.to_id();
|
||||
let item_id = SnowflakeIdGenerator::from_sequence_id(xxhash_rust::xxh3::xxh3_64(
|
||||
sample.as_slice(),
|
||||
))
|
||||
.unwrap_or_default();
|
||||
let item_id = server.inner.data.registry_id_gen.generate();
|
||||
batch
|
||||
.set(
|
||||
BlobOp::Link {
|
||||
|
||||
Reference in New Issue
Block a user