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:
parent
a1bf790784
commit
8a106ca64f
2 changed files with 9 additions and 0 deletions
|
@ -317,6 +317,7 @@ class Net::LDAP
|
||||||
2 => "Protocol Error",
|
2 => "Protocol Error",
|
||||||
3 => "Time Limit Exceeded",
|
3 => "Time Limit Exceeded",
|
||||||
4 => "Size Limit Exceeded",
|
4 => "Size Limit Exceeded",
|
||||||
|
10 => "Referral",
|
||||||
12 => "Unavailable crtical extension",
|
12 => "Unavailable crtical extension",
|
||||||
14 => "saslBindInProgress",
|
14 => "saslBindInProgress",
|
||||||
16 => "No Such Attribute",
|
16 => "No Such Attribute",
|
||||||
|
@ -1418,6 +1419,13 @@ class Net::LDAP::Connection #:nodoc:
|
||||||
when 5 # search-result
|
when 5 # search-result
|
||||||
result_code = pdu.result_code
|
result_code = pdu.result_code
|
||||||
controls = pdu.result_controls
|
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
|
break
|
||||||
else
|
else
|
||||||
raise Net::LDAP::LdapError, "invalid response-type in search: #{pdu.app_tag}"
|
raise Net::LDAP::LdapError, "invalid response-type in search: #{pdu.app_tag}"
|
||||||
|
|
|
@ -136,6 +136,7 @@ class Net::LDAP::PDU
|
||||||
:matchedDN => sequence[1],
|
:matchedDN => sequence[1],
|
||||||
:errorMessage => sequence[2]
|
:errorMessage => sequence[2]
|
||||||
}
|
}
|
||||||
|
parse_search_referral(sequence[3]) if @ldap_result[:resultCode] == 10
|
||||||
end
|
end
|
||||||
private :parse_ldap_result
|
private :parse_ldap_result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue