Skip to content

Commit 8ba4796

Browse files
committed
use non-blocking connect only when timeout is set
1 parent b5b6d5a commit 8ba4796

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/net/ldap/connection.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def self.wrap_with_ssl(io, tls_options = {}, timeout=nil)
8989
conn = OpenSSL::SSL::SSLSocket.new(io, ctx)
9090

9191
begin
92-
conn.connect_nonblock
92+
if timeout
93+
conn.connect_nonblock
94+
else
95+
conn.connect
96+
end
9397
rescue IO::WaitReadable
9498
if IO.select([conn], nil, nil, timeout)
9599
retry

0 commit comments

Comments
 (0)