Skip to content

Commit 9a2e26e

Browse files
committed
preserve existing behavior
1 parent e9a1bf1 commit 9a2e26e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/net/ldap.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,12 +1237,16 @@ def use_connection(args)
12371237

12381238
# Establish a new connection to the LDAP server
12391239
def new_connection
1240-
Net::LDAP::Connection.new \
1240+
connection = Net::LDAP::Connection.new \
12411241
:host => @host,
12421242
:port => @port,
12431243
:hosts => @hosts,
12441244
:encryption => @encryption,
12451245
:instrumentation_service => @instrumentation_service
1246+
1247+
# Force connect to see if there's a connection error
1248+
connection.socket
1249+
connection
12461250
rescue Errno::ECONNREFUSED, Net::LDAP::ConnectionRefusedError => e
12471251
@result = {
12481252
:resultCode => 52,

0 commit comments

Comments
 (0)