Skip to content

Commit 4a415bc

Browse files
committed
preserve existing socket init code
1 parent d5e6afd commit 4a415bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/net/ldap/connection.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@ def socket
606606
# First refactoring uses the existing methods open_connection and
607607
# prepare_socket to set @conn. Next cleanup would centralize connection
608608
# handling here.
609-
open_connection(@server)
609+
if @server[:socket]
610+
prepare_socket(@server)
611+
else
612+
@server[:hosts] = [[@server[:host], @server[:port]]] if @server[:hosts].nil?
613+
open_connection(@server)
614+
end
615+
616+
@conn
610617
end
611618
end # class Connection

0 commit comments

Comments
 (0)