Ignore:
Timestamp:
Jan 11, 2011, 11:05:25 AM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Client 2.1: caching parameter, text improvments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/src/ndpsmb.c

    r514 r519  
    117117        { ND_PROP_ULONG, 0, "MASTERTYPE", "1"},
    118118        { ND_PROP_ULONG, 0, "EASUPPORT", "1"},
     119        {ND_PROP_ULONG, 0, "CTO", "10"},
     120        {ND_PROP_ULONG, 0, "CLD", "32"},
    119121        {ND_PROP_STRING, 0, NULL, NULL}
    120122};
     
    407409        }
    408410
    409         /* Create a directory cache with expiration time 15 seconds and up to 32 listings cached. */
    410         dircache_create(&pRes->pdc, 15, 32);
     411        t = 0;
     412        rc = ph->fsphQueryUlongProperty (properties, "CTO", &t);
     413        if (!rc)
     414        {
     415                if (t > 600)
     416                {
     417                        rc = ERROR_INVALID_PARAMETER;
     418                }
     419                else
     420                {
     421                        pRes->cachetimeout = t;
     422                }
     423        }
     424
     425        t = 0;
     426        rc = ph->fsphQueryUlongProperty (properties, "CLD", &t);
     427        if (!rc)
     428        {
     429                if (t > 96)
     430                {
     431                        rc = ERROR_INVALID_PARAMETER;
     432                }
     433                else
     434                {
     435                        pRes->cachedepth = t;
     436                }
     437        }
     438
     439        /*
     440         * Create a directory cache with expiration time and cache listings
     441         * the above values come from the gui. default: timeout 10; listings: 32
     442         */
     443        dircache_create(&pRes->pdc, pRes->cachetimeout, pRes->cachedepth);
    411444
    412445        return rc;
Note: See TracChangeset for help on using the changeset viewer.