Merge pull request #26 from ManageIQ/continuation-reference-processing

Added Continuation Reference Processing as defined in section 4.5.3 of RFC 2251 (http://www.ietf.org/rfc/rfc2251.txt)
This commit is contained in:
Rory O'Connell 2011-12-28 12:52:22 -08:00
commit 76a81cce4a
2 changed files with 9 additions and 0 deletions

View file

@ -317,6 +317,7 @@ class Net::LDAP
2 => "Protocol Error",
3 => "Time Limit Exceeded",
4 => "Size Limit Exceeded",
10 => "Referral",
12 => "Unavailable crtical extension",
14 => "saslBindInProgress",
16 => "No Such Attribute",
@ -1418,6 +1419,13 @@ class Net::LDAP::Connection #:nodoc:
when 5 # search-result
result_code = pdu.result_code
controls = pdu.result_controls
if return_referrals && result_code == 10
if block_given?
se = Net::LDAP::Entry.new
se[:search_referrals] = (pdu.search_referrals || [])
yield se
end
end
break
else
raise Net::LDAP::LdapError, "invalid response-type in search: #{pdu.app_tag}"

View file

@ -136,6 +136,7 @@ class Net::LDAP::PDU
:matchedDN => sequence[1],
:errorMessage => sequence[2]
}
parse_search_referral(sequence[3]) if @ldap_result[:resultCode] == 10
end
private :parse_ldap_result