Skip to content

Commit 013c13f

Browse files
author
Austin Ziegler
committed
Merge branch 'paging_control' of https://github.com/Jamstah/ruby-net-ldap into jamstah-paging_control
2 parents 811369c + 51f2c95 commit 013c13f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/net/ldap.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,14 +1381,15 @@ def search(args = {})
13811381
search_attributes.to_ber_sequence
13821382
].to_ber_appsequence(3)
13831383

1384-
controls = [
1384+
controls = []
1385+
controls <<
13851386
[
13861387
Net::LDAP::LdapControls::PagedResults.to_ber,
13871388
# Criticality MUST be false to interoperate with normal LDAPs.
13881389
false.to_ber,
13891390
rfc2696_cookie.map{ |v| v.to_ber}.to_ber_sequence.to_s.to_ber
1390-
].to_ber_sequence
1391-
].to_ber_contextspecific(0)
1391+
].to_ber_sequence if paged_searches_supported
1392+
controls = controls.to_ber_contextspecific(0)
13921393

13931394
pkt = [next_msgid.to_ber, request, controls].to_ber_sequence
13941395
@conn.write pkt

0 commit comments

Comments
 (0)