diff options
author | Jeremy Allison <jra@samba.org> | 2005-01-28 21:01:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2005-01-28 21:01:58 +0000 |
commit | d78bad36c607b27a5a00d39ff2667dac841c28d2 (patch) | |
tree | 99e37cb05af0ea721f881c4382a94664fd05c08a /source/smbd/filename.c | |
parent | 4c354905c69c9c25f30a15eed52a0f2c512a51d5 (diff) | |
download | samba-d78bad36c607b27a5a00d39ff2667dac841c28d2.tar.gz samba-d78bad36c607b27a5a00d39ff2667dac841c28d2.tar.xz samba-d78bad36c607b27a5a00d39ff2667dac841c28d2.zip |
r5063: Shamelessly steal the Samba4 logic (and some code :-) for directory
evaluation. This stops us from reading the entire directory into
memory at one go, and allows partial reads. It also keeps almost
the same interface to the OpenDir/ReadDir etc. code (sorry James :-).
Next I will optimise the findfirst with exact match code. This speeds
up our interactive response for large directories, but not when a
missing (ie. negative) findfirst is done.
Jeremy
Diffstat (limited to 'source/smbd/filename.c')
-rw-r--r-- | source/smbd/filename.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/smbd/filename.c b/source/smbd/filename.c index 279c9dd3c45..fa8ddfd6ca9 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -435,6 +435,7 @@ static BOOL scan_directory(connection_struct *conn, const char *path, char *name void *cur_dir; const char *dname; BOOL mangled; + long curpos; mangled = mangle_is_mangled(name); @@ -459,7 +460,8 @@ static BOOL scan_directory(connection_struct *conn, const char *path, char *name } /* now scan for matching names */ - while ((dname = ReadDirName(cur_dir))) { + curpos = 0; + while ((dname = ReadDirName(cur_dir, &curpos))) { /* Is it dot or dot dot. */ if ((dname[0] == '.') && (!dname[1] || (dname[1] == '.' && !dname[2]))) { |