seokjin0414 commented on code in PR #2768:
URL: https://github.com/apache/iggy/pull/2768#discussion_r2827563729
##########
core/sdk/src/quic/quic_client.rs:
##########
@@ -165,14 +165,9 @@ impl QuicClient {
/// Create a new QUIC client for the provided configuration.
pub fn create(config: Arc<QuicClientConfig>) -> Result<Self, IggyError> {
- let server_address = config
- .server_address
- .parse::<SocketAddr>()
- .map_err(|error| {
- error!("Invalid server address: {error}");
- IggyError::InvalidServerAddress
- })?;
- let client_address = if server_address.is_ipv6()
+ let resolved_addr = config.server_address.parse::<SocketAddr>().ok();
+
+ let client_address = if resolved_addr.is_some_and(|a| a.is_ipv6())
&& config.client_address ==
QuicClientConfig::default().client_address
{
"[::1]:0"
Review Comment:
Thanks for the review
Fixed — changed parse::<SocketAddr>().ok() to to_socket_addrs().ok() which
does blocking DNS in create(), so IPv6 hostnames are now correctly detected.
Making create() async is beyond scope of this PR 🥲
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]