Skip to content

Commit

Permalink
Critical bug fix: Fix cluster-mode TLS disabled client to properly ta…
Browse files Browse the repository at this point in the history
…ke received IPs when DNS is expanded
  • Loading branch information
barshaul committed Jul 11, 2024
1 parent ca36bd4 commit ee3119d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions redis/src/aio/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
) -> RedisResult<(T, Option<IpAddr>)> {
Ok(match connection_info.addr {
ConnectionAddr::Tcp(ref host, port) => {
if let Some(socket_addr) = _socket_addr {
return Ok::<_, RedisError>((
<T>::connect_tcp(socket_addr).await?,
Some(socket_addr.ip()),
));
}
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
info!("IP of node {:?} is {:?}", host, socket_addr.ip());
Expand Down

0 comments on commit ee3119d

Please sign in to comment.