From dc0ad8dbdf7e69d17b64d0b3b660d46853ed8e83 Mon Sep 17 00:00:00 2001 From: Benjamin Cubbage Date: Tue, 10 Mar 2026 21:39:26 -0400 Subject: [PATCH] Fix bug where read/write timeout option checks were swapped --- cdk/foundation/connection_tcpip.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cdk/foundation/connection_tcpip.cc b/cdk/foundation/connection_tcpip.cc index 20a84e682..8dcad7548 100644 --- a/cdk/foundation/connection_tcpip.cc +++ b/cdk/foundation/connection_tcpip.cc @@ -78,9 +78,9 @@ void connection_TCPIP_impl::do_connect() // Note: Setting timeouts in microseconds. No need to convert. - if (m_opts.has_write_timeout()) - connection::detail::set_timeout(m_sock, m_opts.get_read_timeout(), true); if (m_opts.has_read_timeout()) + connection::detail::set_timeout(m_sock, m_opts.get_read_timeout(), true); + if (m_opts.has_write_timeout()) connection::detail::set_timeout(m_sock, m_opts.get_write_timeout(), false); } @@ -129,9 +129,9 @@ void connection_Unix_socket_impl::do_connect() // Note: Conversion from milliseconds to microseconds. // TODO: Do we really need/want to set timeouts on Unix socket? - if (m_opts.has_write_timeout()) - connection::detail::set_timeout(m_sock, 1000 * m_opts.get_read_timeout(), true); if (m_opts.has_read_timeout()) + connection::detail::set_timeout(m_sock, 1000 * m_opts.get_read_timeout(), true); + if (m_opts.has_write_timeout()) connection::detail::set_timeout(m_sock, 1000 * m_opts.get_write_timeout(), false); }