Skip to content

Commit

Permalink
Merge branch 'paging_control' of https://github.com/Jamstah/ruby-net-…
Browse files Browse the repository at this point in the history
…ldap into jamstah-paging_control
  • Loading branch information
Austin Ziegler committed Mar 18, 2011
2 parents 811369c + 51f2c95 commit 013c13f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/net/ldap.rb
Expand Up @@ -1381,14 +1381,15 @@ def search(args = {})
search_attributes.to_ber_sequence
].to_ber_appsequence(3)

controls = [
controls = []
controls <<
[
Net::LDAP::LdapControls::PagedResults.to_ber,
# Criticality MUST be false to interoperate with normal LDAPs.
false.to_ber,
rfc2696_cookie.map{ |v| v.to_ber}.to_ber_sequence.to_s.to_ber
].to_ber_sequence
].to_ber_contextspecific(0)
].to_ber_sequence if paged_searches_supported
controls = controls.to_ber_contextspecific(0)

pkt = [next_msgid.to_ber, request, controls].to_ber_sequence
@conn.write pkt
Expand Down

0 comments on commit 013c13f

Please sign in to comment.