Use dns_resolver2 per reqwest client builder deprecation notice.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -42,7 +42,7 @@ impl crate::Service for Service {
|
|||||||
|
|
||||||
Ok(Arc::new(Self {
|
Ok(Arc::new(Self {
|
||||||
default: create_client!(config, services; base(config)?
|
default: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))),
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))),
|
||||||
|
|
||||||
url_preview: create_client!(config, services; {
|
url_preview: create_client!(config, services; {
|
||||||
let url_preview_bind_addr = config
|
let url_preview_bind_addr = config
|
||||||
@@ -60,16 +60,16 @@ impl crate::Service for Service {
|
|||||||
builder_interface(builder, url_preview_bind_iface.as_deref())
|
builder_interface(builder, url_preview_bind_iface.as_deref())
|
||||||
})?
|
})?
|
||||||
.local_address(url_preview_bind_addr)
|
.local_address(url_preview_bind_addr)
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
}),
|
}),
|
||||||
|
|
||||||
extern_media: create_client!(config, services; base(config)?
|
extern_media: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))
|
||||||
.redirect(redirect::Policy::limited(3))),
|
.redirect(redirect::Policy::limited(3))),
|
||||||
|
|
||||||
well_known: create_client!(config, services; base(config)?
|
well_known: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))
|
||||||
.connect_timeout(Duration::from_secs(config.well_known_conn_timeout))
|
.connect_timeout(Duration::from_secs(config.well_known_conn_timeout))
|
||||||
.read_timeout(Duration::from_secs(config.well_known_timeout))
|
.read_timeout(Duration::from_secs(config.well_known_timeout))
|
||||||
.timeout(Duration::from_secs(config.well_known_timeout))
|
.timeout(Duration::from_secs(config.well_known_timeout))
|
||||||
@@ -77,20 +77,20 @@ impl crate::Service for Service {
|
|||||||
.redirect(redirect::Policy::limited(4))),
|
.redirect(redirect::Policy::limited(4))),
|
||||||
|
|
||||||
federation: create_client!(config, services; base(config)?
|
federation: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver.hooked))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver.hooked))
|
||||||
.read_timeout(Duration::from_secs(config.federation_timeout))
|
.read_timeout(Duration::from_secs(config.federation_timeout))
|
||||||
.pool_max_idle_per_host(config.federation_idle_per_host.into())
|
.pool_max_idle_per_host(config.federation_idle_per_host.into())
|
||||||
.pool_idle_timeout(Duration::from_secs(config.federation_idle_timeout))
|
.pool_idle_timeout(Duration::from_secs(config.federation_idle_timeout))
|
||||||
.redirect(redirect::Policy::limited(3))),
|
.redirect(redirect::Policy::limited(3))),
|
||||||
|
|
||||||
synapse: create_client!(config, services; base(config)?
|
synapse: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver.hooked))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver.hooked))
|
||||||
.read_timeout(Duration::from_secs(305))
|
.read_timeout(Duration::from_secs(305))
|
||||||
.pool_max_idle_per_host(0)
|
.pool_max_idle_per_host(0)
|
||||||
.redirect(redirect::Policy::limited(3))),
|
.redirect(redirect::Policy::limited(3))),
|
||||||
|
|
||||||
sender: create_client!(config, services; base(config)?
|
sender: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver.hooked))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver.hooked))
|
||||||
.read_timeout(Duration::from_secs(config.sender_timeout))
|
.read_timeout(Duration::from_secs(config.sender_timeout))
|
||||||
.timeout(Duration::from_secs(config.sender_timeout))
|
.timeout(Duration::from_secs(config.sender_timeout))
|
||||||
.pool_max_idle_per_host(1)
|
.pool_max_idle_per_host(1)
|
||||||
@@ -98,7 +98,7 @@ impl crate::Service for Service {
|
|||||||
.redirect(redirect::Policy::limited(2))),
|
.redirect(redirect::Policy::limited(2))),
|
||||||
|
|
||||||
appservice: create_client!(config, services; base(config)?
|
appservice: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))
|
||||||
.connect_timeout(Duration::from_secs(5))
|
.connect_timeout(Duration::from_secs(5))
|
||||||
.read_timeout(Duration::from_secs(config.appservice_timeout))
|
.read_timeout(Duration::from_secs(config.appservice_timeout))
|
||||||
.timeout(Duration::from_secs(config.appservice_timeout))
|
.timeout(Duration::from_secs(config.appservice_timeout))
|
||||||
@@ -107,7 +107,7 @@ impl crate::Service for Service {
|
|||||||
.redirect(redirect::Policy::limited(2))),
|
.redirect(redirect::Policy::limited(2))),
|
||||||
|
|
||||||
pusher: create_client!(config, services; base(config)?
|
pusher: create_client!(config, services; base(config)?
|
||||||
.dns_resolver(Arc::clone(&services.resolver.resolver))
|
.dns_resolver2(Arc::clone(&services.resolver.resolver))
|
||||||
.pool_max_idle_per_host(1)
|
.pool_max_idle_per_host(1)
|
||||||
.pool_idle_timeout(Duration::from_secs(config.pusher_idle_timeout))
|
.pool_idle_timeout(Duration::from_secs(config.pusher_idle_timeout))
|
||||||
.redirect(redirect::Policy::limited(2))),
|
.redirect(redirect::Policy::limited(2))),
|
||||||
|
|||||||
Reference in New Issue
Block a user