From: Graham B. <gb...@po...> - 2000-06-27 20:34:27
|
Can you turn on debug with $ldap->debug(3); and send the packet you get just before the decode error. Graham. On Tue, Jun 27, 2000 at 11:42:25AM -0700, Allen, Robbie wrote: > Thanks. The controls seem to make it to the server ok, but I get a > decode error after the search method. Subsequently, the control method > in Message.pm always returns undef. So for Paged and VLV, I can only > get the first set of data. This is not a problem Sort since it is only > called once (which works fine btw). > > #================================================ > > Output: > > Net::LDAP::VERSION = 0.19 > Convert::ASN1::VERSION = 0.07 > Error msg: decode error at > /usr/SD/perl5.004_05/lib/site_perl/Convert/ASN1/_decode.pm line 63. > Resp = > > #================================================ > > Code: > > use Net::LDAP; > use Net::LDAP::Control; # this wouldn't be necessary if Paged.pm use'd > it > use Net::LDAP::Control::Paged; > use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED ); > > print "Net::LDAP::VERSION = $Net::LDAP::VERSION\n"; > print "Convert::ASN1::VERSION = $Convert::ASN1::VERSION\n"; > > my $ldap = Net::LDAP->new($LDAP_SERVER) or die "$@"; > my $mesg = $ldap->bind('dn' => $BIND_DN, 'password' => $PASSWD); > $mesg->code && die $mesg->error; > > $page = Net::LDAP::Control::Paged->new( size => 10); > $mesg = > $ldap->search(base=>"cn=subnets,cn=sites,cn=configuration,$BASE_DN", > scope=>"subtree", > filter=>"(objectClass=subnet)", > control => [ $page ]); > print "Error msg: ",$mesg->error,"\n" if $mesg->error; > $resp = $mesg->control( LDAP_CONTROL_PAGED ); > print "Resp = $resp\n"; > > #================================================ > > > > -----Original Message----- > > From: Graham Barr [mailto:gb...@po...] > > Sent: Monday, June 26, 2000 10:17 PM > > To: Allen, Robbie > > Cc: 'per...@li...' > > Subject: Re: Page or VLV control > > > > > > On Mon, Jun 26, 2000 at 08:18:34PM -0700, Allen, Robbie wrote: > > > Do the VLV.pm or Paged.pm modules work under Net::LDAP? If > > so, do you > > > have any examples? > > > > Both of these are still under developement, so feel free to > > give any feedback. > > > > Paged should work something like > > > > $paged = Net::LDAP::Control::Paged->new( size => 10 ); > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > $ctrl = $mesg->control( LDAP_CONTROL_PAGED ); > > > > $paged->cookie($ctrl->cookie) if $ctrl; > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > VLV takes these arguments > > > > $vlv = Net::LDAP::Control::VLV->new( > > before => $beforeCount, > > after => $afterCount, > > assert => $assertValue, > > offset => $offset, > > content => $contentCount, > > context => $contextID, # just noticed a bug that this > > is missing from new() > > ); > > > > If assert is present offset and content are not used. There > > are methods > > by the same names for setting the values. > > > > In the response you will get a LDAP_CONTROL_VLVRESPONSE which > > will have > > methods target, result, content and context > > > > Graham. > > > > > > |