Improve performance for cd/ls for containers with a large number of
entries. Patch from Yann Cezard <yann.cezard@univ-pau.fr>. FossilOrigin-Name: 873471574ca4aa3e01b9e0a30a151e9537bc4600938f61daa3c6c0c1dfef446b
This commit is contained in:
parent
d91b74c290
commit
d676104d7a
1 changed files with 6 additions and 2 deletions
8
shelldap
8
shelldap
|
|
@ -996,7 +996,7 @@ sub run_cd
|
||||||
$self->base( $newbase );
|
$self->base( $newbase );
|
||||||
|
|
||||||
# get new 'cwd' listing
|
# get new 'cwd' listing
|
||||||
my $s = $self->search({ scope => 'one' });
|
my $s = $self->search({ scope => 'one', attrs => ['dn'] });
|
||||||
if ( $s->{'code'} ) {
|
if ( $s->{'code'} ) {
|
||||||
print "$s->{'message'}\n";
|
print "$s->{'message'}\n";
|
||||||
return;
|
return;
|
||||||
|
|
@ -1398,6 +1398,7 @@ sub run_list
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my @filters = @_;
|
my @filters = @_;
|
||||||
my $base = $self->base();
|
my $base = $self->base();
|
||||||
|
my $attrs = [ 'dn', 'hasSubordinates' ];
|
||||||
|
|
||||||
# setup filters
|
# setup filters
|
||||||
my ( $flags, $filter );
|
my ( $flags, $filter );
|
||||||
|
|
@ -1415,13 +1416,16 @@ sub run_list
|
||||||
if ( $flags ) {
|
if ( $flags ) {
|
||||||
$recurse = $flags =~ /R/;
|
$recurse = $flags =~ /R/;
|
||||||
$long = $flags =~ /l/;
|
$long = $flags =~ /l/;
|
||||||
|
if ($long) {
|
||||||
|
$attrs = [ '*', 'hasSubordinates' ];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $s = $self->search({
|
my $s = $self->search({
|
||||||
scope => $recurse ? 'sub' : 'one',
|
scope => $recurse ? 'sub' : 'one',
|
||||||
vals => 1,
|
vals => 1,
|
||||||
filter => $filter,
|
filter => $filter,
|
||||||
attrs => [ '*', 'hasSubordinates' ]
|
attrs => $attrs
|
||||||
});
|
});
|
||||||
if ( $s->{'code'} ) {
|
if ( $s->{'code'} ) {
|
||||||
print "$s->{'message'}\n";
|
print "$s->{'message'}\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue