Ignore:
Timestamp:
Dec 30, 2016, 9:42:50 AM (9 years ago)
Author:
Paul Smedley
Message:

client-3.0: revert mistaken commit of dircache.c, add cache support to list_files_smb2

File:
1 edited

Legend:

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

    r1001 r1003  
    957957        smbwrp_fileinfo wrpfinfo;
    958958
     959        //Init cache - don't know number of files so init with 128
     960        dircachectx = dircache_write_begin(state, 128);
     961
    959962        if (smbXcli_conn_has_async_calls(cli->conn)) {
    960963                /*
     
    10751078                                        pathname,
    10761079                                        state);
     1080                                // Also add the entry to the cache.
     1081                                dircache_write_entry(dircachectx, &wrpfinfo);
    10771082
    10781083                                if (!NT_STATUS_IS_OK(status)) {
     
    11181123                status = NT_STATUS_NO_SUCH_FILE;
    11191124        }
    1120 
     1125        dircache_write_end(dircachectx);
    11211126  fail:
    11221127
     
    11481153        smbwrp_fileinfo wrpfinfo;
    11491154
     1155        /* Try to get the listing from cache. */
     1156        if (dircache_list_files(fn, state, &num_finfo))
     1157        {
     1158                /* Got from cache. */
     1159                return(num_finfo);
     1160        }
     1161
    11501162        if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
    11511163        debuglocal(4,"SMB2 detected, calling list_files_smb2()\n");
    11521164                return list_files_smb2(cli, mask, attribute, fn, state);
    1153         }
    1154 
    1155         /* Try to get the listing from cache. */
    1156         if (dircache_list_files(fn, state, &num_finfo))
    1157         {
    1158                 /* Got from cache. */
    1159                 return(num_finfo);
    11601165        }
    11611166
Note: See TracChangeset for help on using the changeset viewer.