Skip to content

Commit 256c7c5

Browse files
committed
Replace packet in write event payload with content_length
1 parent 79c04ce commit 256c7c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/net/ldap.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,8 @@ def read(syntax = Net::LDAP::AsnSyntax)
12951295
# Returns the return value from writing to the connection, which in some
12961296
# cases is the Integer number of bytes written to the socket.
12971297
def write(packet)
1298-
instrument "write.net_ldap_connection", :packet => packet do
1299-
@conn.write(packet)
1298+
instrument "write.net_ldap_connection" do |payload|
1299+
payload[:content_length] = @conn.write(packet)
13001300
end
13011301
end
13021302
private :write

spec/unit/ldap_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
# a write event
145145
payload, result = events.pop
146146
payload.should have_key(:result)
147-
payload.should have_key(:packet)
147+
payload.should have_key(:content_length)
148148
end
149149

150150
it "should publish a read.net_ldap_connection event" do

0 commit comments

Comments
 (0)