diff options
author | Jeremy Allison <jra@samba.org> | 2005-01-28 21:01:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:13 -0500 |
commit | de728fa81ae549b496f2ff26ebb082092aae2204 (patch) | |
tree | 3d3198f7422045cc496c9fc318f2c3ae98e11d8a /source3/smbd/filename.c | |
parent | 575ff396254cc433b8b73a9d8d2e649dde9b364d (diff) | |
download | samba-de728fa81ae549b496f2ff26ebb082092aae2204.tar.gz samba-de728fa81ae549b496f2ff26ebb082092aae2204.tar.bz2 samba-de728fa81ae549b496f2ff26ebb082092aae2204.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
(This used to be commit 0af1d2f6f24f238cb05e10d7d53dcd5b5e0f5f5d)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r-- | source3/smbd/filename.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 279c9dd3c4..fa8ddfd6ca 100644 --- a/source3/smbd/filename.c +++ b/source3/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]))) { |