Skip to content

Commit 8b77189

Browse files
committed
Use queued_read in modify
1 parent c00105e commit 8b77189

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/net/ldap/connection.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,15 @@ def self.modify_ops(operations)
583583
def modify(args)
584584
modify_dn = args[:dn] or raise "Unable to modify empty DN"
585585
ops = self.class.modify_ops args[:operations]
586-
request = [ modify_dn.to_ber,
587-
ops.to_ber_sequence ].to_ber_appsequence(Net::LDAP::PDU::ModifyRequest)
588-
write(request)
589586

590-
pdu = read
587+
message_id = next_msgid
588+
request = [
589+
modify_dn.to_ber,
590+
ops.to_ber_sequence
591+
].to_ber_appsequence(Net::LDAP::PDU::ModifyRequest)
592+
593+
write(request, nil, message_id)
594+
pdu = queued_read(message_id)
591595

592596
if !pdu || pdu.app_tag != Net::LDAP::PDU::ModifyResponse
593597
raise Net::LDAP::LdapError, "response missing or invalid"

0 commit comments

Comments
 (0)