Changeset 497 for branches/client-2.0/src/ndpsmb.c
- Timestamp:
- Dec 13, 2010, 4:05:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/client-2.0/src/ndpsmb.c
r493 r497 224 224 225 225 226 staticPLUGINHELPERTABLE2L *ph;226 PLUGINHELPERTABLE2L *ph; 227 227 static int ifL; 228 228 … … 397 397 pRes->krb5support = 0; 398 398 #endif 399 pRes->pdc = NULL; 399 400 400 401 t = 0, q = NULL; … … 503 504 } 504 505 } 506 507 /* Create a directory cache with expiration time 15 seconds and up to 32 listings cached. */ 508 dircache_create(&pRes->pdc, 10, 32); 505 509 506 510 return rc; … … 727 731 { 728 732 Resource *pRes = (Resource *)resource; 733 dircache_delete(pRes->pdc); 729 734 MemSet(&pRes->srv, 0, sizeof(pRes->srv)); 730 735 free(pRes); … … 963 968 964 969 do { 970 /* First check if there is information in the directory cache. */ 971 unsigned long ulAge = 0; 972 if (dircache_find_path(pRes->pdc, szPath, &finfo, &ulAge)) 973 { 974 if (ulAge <= 15) /* @todo configurable. */ 975 { 976 rc = NO_ERROR; 977 finfo.easize = -1; 978 getfindinfoL(pConn, plist, &finfo, 0, NULL); 979 break; 980 } 981 } 965 982 966 983 rc = pathparser(pRes, pConn, szPath, path); … … 1092 1109 strcpy( state.dir_mask, mask); 1093 1110 strcpy( state.mask, path); 1111 state.fullpath = szPath; 1112 /* This plugin always reads a complete directory listing and filters results 1113 * using actual mask (state.dir_mask) in getfindinfoL. 1114 * May be this was a workaround for some server bug. 1115 * If this will be changed, then directory listing cache must be changed too, 1116 * and must remember the mask, which was used to obtain a listing. 1117 * Now the directory cache saves complete directory listings and then uses them to find 1118 * information about single files. 1119 * However, with a directory cache, it is probably faster to get a full listing and 1120 * then use it to obtain info about separate files than to perform a network 1121 * list query operation using actual wild cards for each file. Some application, 1122 * for example OpenOffice, do this. 1123 */ 1094 1124 p = getlastslash(state.mask); 1095 1125 if (p) … … 1102 1132 strcpy(state.mask, "\\*"); 1103 1133 } 1134 debuglocal(9,"NdpFindStart: dir [%s], dir_mask [%s], mask [%s], szPath [%s]\n", 1135 state.dir, state.dir_mask, state.mask, state.fullpath); 1104 1136 rc = smbwrp_filelist( &pRes->srv, pConn->cli, &state); 1105 1137 // we need to handle reconnection also here, because NdpQueryPathInfo … … 1468 1500 debuglocal(9,"NdpForceDelete in\n"); 1469 1501 1502 dircache_invalidate(szFile, pRes->pdc, 1); 1503 1470 1504 do { 1471 1505 rc = pathparser(pRes, pConn, szFile, path); … … 1492 1526 debuglocal(9,"NdpCreateDir in\n"); 1493 1527 1528 dircache_invalidate(szDirName, pRes->pdc, 1); 1529 1494 1530 do { 1495 1531 rc = pathparser(pRes, pConn, szDirName, path); … … 1516 1552 debuglocal(9,"NdpDeleteDir in\n"); 1517 1553 1554 dircache_invalidate(szDir, pRes->pdc, 1); 1555 1518 1556 do { 1519 1557 rc = pathparser(pRes, pConn, szDir, path); … … 1541 1579 1542 1580 debuglocal(9,"NdpMove in from <%s> to <%s>\n", szSrc, szDst); 1581 1582 dircache_invalidate(szSrc, pRes->pdc, 1); 1583 dircache_invalidate(szDst, pRes->pdc, 1); 1543 1584 1544 1585 do … … 1595 1636 debuglocal(9,"smbopen in %d\n", pConn->file.fd); 1596 1637 1638 if (flags & O_CREAT) 1639 { 1640 dircache_invalidate(szFileName, pRes->pdc, 1); 1641 } 1597 1642 do { 1598 1643 if (pConn->file.fd > 0)
Note:
See TracChangeset
for help on using the changeset viewer.