From fece50c844ea37b54661580ddd15e4bf7d446fe1 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Wed, 24 Mar 2010 21:48:01 -0400 Subject: [PATCH] Making return codes consistent for add and modify. --- History.txt | 4 ++++ lib/net/ldap.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/History.txt b/History.txt index a93bf83..ca52989 100644 --- a/History.txt +++ b/History.txt @@ -28,6 +28,10 @@ * Replaced calls to #to_a with calls to Kernel#Array; since Ruby 1.8.3, the default #to_a implementation has been deprecated and should be replaced either with calls to Kernel#Array or [value].flatten(1). + * Modified #add and #modify to return a Pdu#result_code instead of a + Pdu#result. This may be changed in Net::LDAP 1.0 to return the full + Pdu#result, but if we do so, it will be that way for all LDAP calls + involving Pdu objects. === Net::LDAP 0.1.1 / 2010-03-18 * Fixing a critical problem with sockets. diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index 7d16093..d0508d6 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -1513,7 +1513,7 @@ module Net @conn.write pkt (be = @conn.read_ber(AsnSyntax)) && (pdu = LdapPdu.new( be )) && (pdu.app_tag == 7) or raise LdapError.new( "response missing or invalid" ) - pdu.result + pdu.result_code end #-- @@ -1536,7 +1536,7 @@ module Net @conn.write pkt (be = @conn.read_ber(AsnSyntax)) && (pdu = LdapPdu.new( be )) && (pdu.app_tag == 9) or raise LdapError.new( "response missing or invalid" ) - pdu.result + pdu.result_code end #--