Ignore:
Timestamp:
Dec 13, 2010, 4:05:51 PM (15 years ago)
Author:
Silvan Scherrer
Message:

samba client: caching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/client-2.0/src/smbwrp.c

    r493 r497  
    10811081        finfo->ctime = def_finfo.ctime_ts.tv_sec;
    10821082        strncpy(finfo->fname, def_finfo.name, sizeof(finfo->fname) - 1);
    1083         debuglocal(9,"fname %s (serverzone %d, level %d)\n",finfo->fname, cli->serverzone, level);
    10841083       
    10851084        switch (level) {
     
    12401239                pstrcpy(mask,Mask);
    12411240
     1241        /* Try to get the listing from cache. */
     1242        if (dircache_list_files(fn, state, &total_received))
     1243        {
     1244                /* Got from cache. */
     1245                return(total_received);
     1246        }
     1247
    12421248        while (ff_eos == 0) {
    12431249                loop_count++;
     
    14251431                total_received = -1;
    14261432        } else {
     1433                void *dircachectx = dircache_write_begin(state, total_received);
     1434
    14271435                /* no connection problem.  let user function add each entry */
    14281436                for (p=dirlist,i=0;i<total_received;i++) {
     
    14301438                                                     &finfo,NULL,NULL,NULL);
    14311439                        fn( mnt,&finfo, Mask, state );
     1440
     1441                        /* Also add the entry to the cache. */
     1442                        dircache_write_entry(dircachectx, &finfo);
    14321443                }
     1444
     1445                dircache_write_end(dircachectx);
    14331446        }
    14341447
Note: See TracChangeset for help on using the changeset viewer.