summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-04-13 22:45:52 +0000
committerChristopher R. Hertel <crh@samba.org>1998-04-13 22:45:52 +0000
commitd5e040247e180664bd32a0d7d8dd905f46cbdb47 (patch)
tree1e30e2ba34eb5b25d7bc2d5214db0f54ede07bad /source3/smbd/server.c
parentcac6a060af598bf94e6414b06e7365ec51ca360e (diff)
downloadsamba-d5e040247e180664bd32a0d7d8dd905f46cbdb47.tar.gz
samba-d5e040247e180664bd32a0d7d8dd905f46cbdb47.tar.bz2
samba-d5e040247e180664bd32a0d7d8dd905f46cbdb47.zip
Changes include:
proto.h: The unusual. ;) reply.c: I changes some function names, and updated reply.c to match. See mangle.c below for more. server.c: Changed function names and parameters in file mangle.c, so changed server.c calls to match. See mangle.c below for more. mangle.c: I replaced the caching mechanism used for caching reverse mangled name maps. The old method was a large array of 256-byte strings. Movement in the stack (including push and pop) was done by memcpy()ing whole chunks of memory around. The new system uses the ubi_Cache module which, in turn, uses a splay tree. Entries are dynamically allocated using a minimum amount of memory. Searches are non-linear, which should speed things up a bit, too. Overall, this should save memory and be faster. Other changes: I streamlined the is_mangled() test and made other speed enhancements including replacing some static functions with macros. Added comments, etc. Note: Per an E'mail conversation with Andrew, the 'mangled stack' parameter in smb.conf doesn't do anything anymore. The cache is now set for 16K bytes maximum memory usage. The mangle stack parameter is silently ignored. This can easily be changed, but I'd rather introduce a 'mangled cache memory' parameter and remove 'mangled stack'. Remaining problems: While testing the module, I noticed that something is calling name_map_mangle() twice. The result is that names which contain illegal characters are getting mangled twice. Also, the entire module works by overwriting the input string. This has a variety of nasty side effects. Summary: There's a lot still to be done, but the changes I have in place *should* work in exactly the same way (except for the mangle stack parameter). The rest of the bugs and other issues are separate. Chris -)----- (This used to be commit 8759bec11ba483b2292b0e513b85c98ed5e3e2d4)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 7216ae79bb..c4db553659 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -464,7 +464,7 @@ static BOOL scan_directory(char *path, char *name,int cnum,BOOL docache)
* (JRA).
*/
if (mangled)
- mangled = !check_mangled_stack(name);
+ mangled = !check_mangled_cache( name );
/* open the directory */
if (!(cur_dir = OpenDir(cnum, path, True)))
@@ -659,7 +659,7 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_pa
/* check on the mangled stack to see if we can recover the
base of the filename */
if (is_mangled(start))
- check_mangled_stack(start);
+ check_mangled_cache( start );
DEBUG(5,("New file %s\n",start));
return(True);
@@ -3305,7 +3305,7 @@ BOOL reload_services(BOOL test)
}
}
- reset_mangled_stack( lp_mangledstack() );
+ reset_mangled_cache();
/* this forces service parameters to be flushed */
become_service(-1,True);