Skip to content

Commit 97e035a

Browse files
committed
Wire up instrumentation_service settings
Configure it on Net::LDAP instance and it will be passed to the Net::LDAP::Connection object.
1 parent 3eefb84 commit 97e035a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/net/ldap.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ def initialize(args = {})
400400
@auth[:password] = pr.call
401401
end
402402

403+
@instrumentation_service = args[:instrumentation_service]
404+
403405
# This variable is only set when we are created with LDAP::open. All of
404406
# our internal methods will connect using it, or else they will create
405407
# their own.
@@ -572,10 +574,12 @@ def open
572574
raise Net::LDAP::LdapError, "Open already in progress" if @open_connection
573575

574576
begin
575-
@open_connection = Net::LDAP::Connection.new(:host => @host,
576-
:port => @port,
577-
:encryption =>
578-
@encryption)
577+
@open_connection =
578+
Net::LDAP::Connection.new \
579+
:host => @host,
580+
:port => @port,
581+
:encryption => @encryption,
582+
:instrumentation_service => @instrumentation_service
579583
@open_connection.bind(@auth)
580584
yield self
581585
ensure
@@ -730,8 +734,11 @@ def bind(auth = @auth)
730734
@result = @open_connection.bind(auth)
731735
else
732736
begin
733-
conn = Connection.new(:host => @host, :port => @port,
734-
:encryption => @encryption)
737+
conn = Connection.new \
738+
:host => @host,
739+
:port => @port,
740+
:encryption => @encryption,
741+
:instrumentation_service => @instrumentation_service
735742
@result = conn.bind(auth)
736743
ensure
737744
conn.close if conn

0 commit comments

Comments
 (0)