Ticket #52: ndpsmb.2.diff
File ndpsmb.2.diff, 12.7 KB (added by , 17 years ago) |
---|
-
ndpsmb.c
1177 1177 char fullname[CCHMAXPATH+1] = {0}; 1178 1178 smbwrp_fileinfo * data; 1179 1179 NDPATHELEMENT *pel = ph->fsphNameElem(0); 1180 int retry = 0; 1180 1181 1181 log("NdpFindStart in\n");1182 1182 do 1183 1183 { 1184 log("NdpFindStart in, retry = %d\n", retry); 1185 do 1186 { 1184 1187 rc = checkconnection(pConn); 1185 1188 if (rc) 1186 1189 { … … 1264 1267 } while (0); 1265 1268 1266 1269 log("NdpFindStart <%s> (%s) cnt %d %d %d\n", szPath, path, count, rc, pConn->rc); 1270 1271 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1272 } while( retry ); 1273 1267 1274 return rc; 1268 1275 } 1269 1276 … … 1372 1379 } 1373 1380 } while (0); 1374 1381 log("NdpQueryInfo <%s> (%s) %d %d\n", szPath, path, rc, pConn->rc); 1375 retry = rc&& !retry;1382 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1376 1383 } while (retry); 1377 1384 1378 1385 return rc; … … 1412 1419 smb_response resp = {0}; 1413 1420 smbwrp_fileinfo * finfo = (smbwrp_fileinfo *)pConn->mem; 1414 1421 char path[CCHMAXPATH+1] = {0}; 1422 int retry = 0; 1415 1423 1416 log("NdpSetPathInfo in\n"); 1424 do 1425 { 1426 log("NdpSetPathInfo in, retry = %d\n", retry); 1417 1427 do { 1418 1428 rc = checkconnection(pConn); 1419 1429 if (rc) … … 1451 1461 } 1452 1462 } while (0); 1453 1463 log("NdpSetPathInfo <%s> (%s) %d %d\n", szPathName, path, rc, pConn->rc); 1464 1465 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1466 } while( retry ); 1467 1454 1468 return rc; 1455 1469 } 1456 1470 … … 1525 1539 FEALIST * pFEASrc; 1526 1540 NDDATABUF fdata = {0}; 1527 1541 smbwrp_fileinfo *finfo; 1542 int retry = 0; 1528 1543 1529 1544 if (!pfi || !pfi->pszName || !pFEAList) 1530 1545 { … … 1544 1559 finfo = (smbwrp_fileinfo *)fdata.pData; 1545 1560 path = finfo->fname; 1546 1561 1547 log("NdpEAQuery in <%s> %08x %d\n", path, pGEAList, pGEAList ? pGEAList->cbList : 0); 1562 do 1563 { 1564 log("NdpEAQuery in <%s> %08x %d, retry = %d\n", path, pGEAList, pGEAList ? pGEAList->cbList : 0, retry); 1548 1565 do { 1549 1566 rc = checkconnection(pConn); 1550 1567 if (rc) … … 1576 1593 } break; 1577 1594 default : 1578 1595 { 1596 if( rc != ERROR_INVALID_PARAMETER || retry ) 1579 1597 rc = ERROR_EAS_NOT_SUPPORTED; 1580 1598 } 1581 1599 } … … 1586 1604 } 1587 1605 } while (0); 1588 1606 log("NdpEAQuery <%s> %d %d %d %d %d\n", pfi->pszName, rc, pFEASrc->cbList, pFEAList->cbList, pConn->rc, resp.rc); 1607 1608 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1609 } while( retry ); 1610 1589 1611 return rc; 1590 1612 } 1591 1613 … … 1600 1622 unsigned long action; 1601 1623 NDDATABUF fdata = {0}; 1602 1624 smbwrp_fileinfo *finfo; 1625 int retry = 0; 1603 1626 1604 log("NdpEASet in\n");1605 1606 1627 if (!pfi || !pfi->pszName || !pFEAList || pFEAList->cbList <= sizeof(long)) 1607 1628 { 1608 1629 return ERROR_EAS_NOT_SUPPORTED; … … 1626 1647 finfo = (smbwrp_fileinfo *)fdata.pData; 1627 1648 path = finfo->fname; 1628 1649 1650 do 1651 { 1652 log("NdpEASet in, retry = %d\n", retry); 1653 1629 1654 do { 1630 1655 rc = checkconnection(pConn); 1631 1656 if (rc) … … 1645 1670 rc = pConn->rc ? pConn->rc : (resp.rc ? resp.rc : ERROR_INVALID_PARAMETER); 1646 1671 } 1647 1672 } while (0); 1673 1674 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1675 } while( retry ); 1676 1648 1677 log("NdpEASet %d\n", rc); 1649 1678 return rc; 1650 1679 } … … 1662 1691 NDDATABUF fdata = {0}; 1663 1692 smbwrp_fileinfo *finfo; 1664 1693 int easize; 1694 int retry = 0; 1665 1695 1666 1696 if (!pfi || !pulEASize) 1667 1697 { … … 1689 1719 return NO_ERROR; 1690 1720 } 1691 1721 1692 log("NdpEASize in <%s> \n", path); 1722 do 1723 { 1724 log("NdpEASize in <%s>, retry = %d \n", path, retry); 1693 1725 do { 1694 1726 rc = checkconnection(pConn); 1695 1727 if (rc) … … 1720 1752 } break; 1721 1753 default : 1722 1754 { 1755 if( rc != ERROR_INVALID_PARAMETER || retry ) 1723 1756 rc = ERROR_EAS_NOT_SUPPORTED; 1724 1757 } 1725 1758 } … … 1727 1760 *pulEASize = pfealist->cbList; 1728 1761 } while (0); 1729 1762 log("NdpEASize <%s> %d %d %d %d\n", pfi->pszName, *pulEASize, rc, pConn->rc, resp.rc); 1763 1764 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1765 } while( retry ); 1766 1730 1767 return rc; 1731 1768 } 1732 1769 … … 1739 1776 int rc = 0; 1740 1777 unsigned long action; 1741 1778 char path[CCHMAXPATH+1] = {0}; 1779 int retry = 0; 1742 1780 1743 log("NdpSetCurrentDir in\n"); 1781 do 1782 { 1783 log("NdpSetCurrentDir in, retry = %d\n", retry); 1744 1784 do { 1745 1785 rc = checkconnection(pConn); 1746 1786 if (rc) … … 1766 1806 } 1767 1807 } while (0); 1768 1808 log("NdpSetCurrentDir <%s> (%s) %d %d\n", szPath, path, rc, pConn->rc); 1809 1810 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1811 } while( retry ); 1812 1769 1813 return rc; 1770 1814 } 1771 1815 … … 1790 1834 int rc = 0; 1791 1835 unsigned long action; 1792 1836 char path[CCHMAXPATH+1] = {0}; 1837 int retry = 0; 1793 1838 1794 log("NdpForceDelete in\n"); 1839 do 1840 { 1841 log("NdpForceDelete in, retry = %d\n", retry); 1795 1842 do { 1796 1843 rc = checkconnection(pConn); 1797 1844 if (rc) … … 1817 1864 } 1818 1865 } while (0); 1819 1866 log("NdpForceDelete <%s> (%s) %d %d\n", szFile, path, rc, pConn->rc); 1867 1868 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1869 } while( retry ); 1870 1820 1871 return rc; 1821 1872 } 1822 1873 … … 1829 1880 int rc = 0; 1830 1881 unsigned long action; 1831 1882 char path[CCHMAXPATH+1] = {0}; 1883 int retry = 0; 1832 1884 1833 log("NdpCreateDir in\n"); 1885 do 1886 { 1887 log("NdpCreateDir in, retry = %d\n", retry); 1834 1888 do { 1835 1889 rc = checkconnection(pConn); 1836 1890 if (rc) … … 1856 1910 } 1857 1911 } while (0); 1858 1912 log("NdpCreateDir <%s> (%s) %d %d\n", szDirName, path, rc, pConn->rc); 1913 1914 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1915 } while( retry ); 1916 1859 1917 return rc; 1860 1918 } 1861 1919 … … 1868 1926 int rc = 0; 1869 1927 unsigned long action; 1870 1928 char path[CCHMAXPATH+1] = {0}; 1929 int retry = 0; 1871 1930 1872 log("NdpDeleteDir in\n"); 1931 do 1932 { 1933 log("NdpDeleteDir in, retry = %d\n", retry); 1873 1934 do { 1874 1935 rc = checkconnection(pConn); 1875 1936 if (rc) … … 1895 1956 } 1896 1957 } while (0); 1897 1958 log("NdpDeleteDir <%s> (%s) %d %d\n", szDir, path, rc, pConn->rc); 1959 1960 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 1961 } while( retry ); 1962 1898 1963 return rc; 1899 1964 } 1900 1965 … … 1909 1974 char src[CCHMAXPATH+1] = {0}; 1910 1975 int l1, l2; 1911 1976 char * p = szDst; 1977 int retry = 0; 1912 1978 1913 log("NdpMove in\n");1914 1979 do 1915 1980 { 1981 log("NdpMove in, retry = %d\n", retry); 1982 do 1983 { 1916 1984 rc = checkconnection(pConn); 1917 1985 if (rc) 1918 1986 { … … 1951 2019 } while (0); 1952 2020 log("NdpMove <%s> -> <%s> (%s) %d %d\n", szSrc, szDst, src, rc, pConn->rc); 1953 2021 2022 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2023 } while( retry ); 2024 1954 2025 return rc; 1955 2026 } 1956 2027 … … 1979 2050 unsigned long action; 1980 2051 int rc = 0; 1981 2052 char path[CCHMAXPATH+1] = {0}; 2053 int retry = 0; 1982 2054 1983 log("smbopen in %d\n", pConn->file.fd); 2055 do 2056 { 2057 log("smbopen in %d, retry = %d\n", pConn->file.fd, retry); 1984 2058 do { 1985 2059 if (pConn->file.fd > 0) 1986 2060 { … … 2035 2109 log("smbopen NdpFileEASet %d. pFEAList->cbList %d\n", rc1, pFEAList->cbList); 2036 2110 } 2037 2111 2112 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2113 } while( retry ); 2114 2038 2115 return rc; 2039 2116 } 2040 2117 … … 2075 2152 smb_response resp = {0}; 2076 2153 smbwrp_fileinfo * finfo = (smbwrp_fileinfo *)pConn->mem; 2077 2154 char path[CCHMAXPATH+1] = {0}; 2155 int retry = 0; 2078 2156 2079 log("NdpSetFileAttribute in\n"); 2157 do 2158 { 2159 log("NdpSetFileAttribute in, retry = %d\n", retry); 2080 2160 do { 2081 2161 rc = checkconnection(pConn); 2082 2162 if (rc) … … 2105 2185 } 2106 2186 } while (0); 2107 2187 log("NdpSetFileAttribute <%s> (%s) %04x %d %d\n", szFileName, path, usAttr, rc, pConn->rc); 2188 2189 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2190 } while( retry ); 2191 2108 2192 return rc; 2109 2193 } 2110 2194 … … 2138 2222 smb_response resp = {0}; 2139 2223 FILEFINDBUF3 buf; 2140 2224 smbwrp_fileinfo * finfo = (smbwrp_fileinfo *)(pConn->mem + sizeof(pConn->file)); 2225 int retry = 0; 2141 2226 2142 log("NdpFileQueryInfo in\n"); 2227 do 2228 { 2229 log("NdpFileQueryInfo in, retry = %d\n", retry); 2143 2230 do { 2144 2231 if (pConn->file.fd < 0 || !*pConn->file.fname) 2145 2232 { … … 2179 2266 } while (0); 2180 2267 log("NdpFileQueryInfo <%s> %d %d\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, rc, pConn->rc); 2181 2268 2269 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2270 } while( retry ); 2271 2182 2272 return rc; 2183 2273 } 2184 2274 … … 2191 2281 smb_request req = {0}; 2192 2282 smb_response resp = {0}; 2193 2283 FEALIST * pFEASrc; 2284 int retry = 0; 2194 2285 2195 2286 if (!pFEAList) 2196 2287 { … … 2201 2292 return ERROR_EAS_NOT_SUPPORTED; 2202 2293 } 2203 2294 2204 log("NdpFileEAQuery in <%s>/%d pGEAList=%08x\n", pConn->file.fname, pConn->file.fd, pGEAList); 2295 do 2296 { 2297 log("NdpFileEAQuery in <%s>/%d pGEAList=%08x, retry = %d\n", pConn->file.fname, pConn->file.fd, pGEAList, retry); 2205 2298 do { 2206 2299 if (pConn->file.fd < 0) 2207 2300 { … … 2238 2331 } break; 2239 2332 default : 2240 2333 { 2334 if( rc != ERROR_INVALID_PARAMETER || retry ) 2241 2335 rc = ERROR_EAS_NOT_SUPPORTED; 2242 2336 } 2243 2337 } … … 2248 2342 } 2249 2343 } while (0); 2250 2344 log("NdpFileEAQuery out <%s>/%d pFEASrc->cbList=%d pFEAList->cbList=%d rc=%d %d %d\n", pConn->file.fname, pConn->file.fd, pFEASrc->cbList, pFEAList->cbList, rc, pConn->rc, resp.rc); 2345 2346 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2347 } while( retry ); 2348 2251 2349 return rc; 2252 2350 } 2253 2351 … … 2259 2357 smb_request req = {0}; 2260 2358 smb_response resp = {0}; 2261 2359 unsigned long action; 2360 int retry = 0; 2262 2361 2263 log("NdpFileEASet in\n");2264 2265 2362 if (!pFEAList || pFEAList->cbList <= sizeof(long)) 2266 2363 { 2267 2364 return ERROR_EAS_NOT_SUPPORTED; … … 2275 2372 return ERROR_NOT_ENOUGH_MEMORY; 2276 2373 } 2277 2374 2375 do 2376 { 2377 log("NdpFileEASet in, retry = %d\n", retry); 2378 2278 2379 do { 2279 2380 if (pConn->file.fd < 0) 2280 2381 { … … 2301 2402 } 2302 2403 } while (0); 2303 2404 log("NdpFileEASet %d\n", rc); 2405 2406 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2407 } while( retry ); 2408 2304 2409 return rc; 2305 2410 } 2306 2411 … … 2314 2419 smb_response resp = {0}; 2315 2420 char path[CCHMAXPATH+1] = {0}; 2316 2421 FEALIST * pfealist; 2422 int retry = 0; 2317 2423 2318 2424 if (!pulEASize) 2319 2425 { … … 2324 2430 return ERROR_EAS_NOT_SUPPORTED; 2325 2431 } 2326 2432 2327 log("NdpFileEASize in <%s>/%d \n", pConn->file.fname, pConn->file.fd); 2433 do 2434 { 2435 log("NdpFileEASize in <%s>/%d, retry = %d\n", pConn->file.fname, pConn->file.fd, retry); 2328 2436 do { 2329 2437 if (pConn->file.fd < 0) 2330 2438 { … … 2360 2468 } break; 2361 2469 default : 2362 2470 { 2471 if( rc != ERROR_INVALID_PARAMETER || retry ) 2363 2472 rc = ERROR_EAS_NOT_SUPPORTED; 2364 2473 } 2365 2474 } … … 2367 2476 *pulEASize = pfealist->cbList; 2368 2477 } while (0); 2369 2478 log("NdpFileEASize %d %d %d %d\n", *pulEASize, rc, pConn->rc, resp.rc); 2479 2480 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2481 } while( retry ); 2482 2370 2483 return rc; 2371 2484 } 2372 2485 … … 2417 2530 unsigned long action; 2418 2531 smb_request req = {0}; 2419 2532 smb_response resp = {0}; 2533 int retry = 0; 2420 2534 2421 log("NdpFileSetFilePtrl in\n"); 2535 do 2536 { 2537 log("NdpFileSetFilePtrl in, retry = %d\n", retry); 2422 2538 do { 2423 2539 if (pConn->file.fd < 0) 2424 2540 { … … 2451 2567 } while (0); 2452 2568 log("NdpFileSetFilePtrL <%s> %lld %lu %lld %d %d\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, llOffset, ulMethod, *pllActual, rc, pConn->rc); 2453 2569 2570 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2571 } while( retry ); 2572 2454 2573 return rc; 2455 2574 } 2456 2575 … … 2471 2590 unsigned long action; 2472 2591 smb_request req = {0}; 2473 2592 smb_response resp = {0}; 2593 int retry = 0; 2474 2594 2475 log("NdpFileClose in %d <%s>\n", pConn->file.fd, pConn->file.fd < 0 ? "!null!" : pConn->file.fname); 2595 do 2596 { 2597 log("NdpFileClose in %d <%s>, retry = %d\n", pConn->file.fd, pConn->file.fd < 0 ? "!null!" : pConn->file.fname, retry); 2476 2598 2477 2599 do { 2478 2600 if (pConn->file.fd < 0) … … 2503 2625 } 2504 2626 } while (0); 2505 2627 log("NdpFileClose %d %d %d\n", pConn->file.fd, rc, pConn->rc); 2628 2629 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2630 } while( retry ); 2631 2506 2632 pConn->file.fd = -1; 2507 2633 return rc; 2508 2634 } … … 2529 2655 unsigned long action; 2530 2656 smb_request req = {0}; 2531 2657 smb_response resp = {0}; 2658 int retry = 0; 2532 2659 2533 log("NdpFileNewSizeL in\n"); 2660 do 2661 { 2662 log("NdpFileNewSizeL in, retry = %d\n", retry); 2534 2663 do { 2535 2664 if (pConn->file.fd < 0) 2536 2665 { … … 2562 2691 } 2563 2692 } while (0); 2564 2693 log("NdpFileNewSizeL <%s> %lld %d %d\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, llLen, rc, pConn->rc); 2694 2695 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2696 } while( retry ); 2697 2565 2698 return rc; 2566 2699 } 2567 2700 … … 2575 2708 unsigned long action; 2576 2709 smb_request req = {0}; 2577 2710 smb_response resp = {0}; 2711 int retry = 0; 2578 2712 2579 log("NdpFileRead in\n"); 2713 do 2714 { 2715 log("NdpFileRead in, retry = %d\n", retry); 2580 2716 // log("NdpFileRead <%s> %lu\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, ulRead); 2581 2717 2582 2718 do { … … 2619 2755 } while (0); 2620 2756 log("NdpFileRead <%s> %lu %lu %d %d\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, ulRead, *pulActual, rc, pConn->rc); 2621 2757 2758 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2759 } while( retry ); 2760 2622 2761 return rc; 2623 2762 } 2624 2763 … … 2632 2771 unsigned long action; 2633 2772 smb_request req = {0}; 2634 2773 smb_response resp = {0}; 2774 int retry = 0; 2635 2775 2636 log("NdpFileWrite in\n"); 2776 do 2777 { 2778 log("NdpFileWrite in, retry = %d\n", retry); 2637 2779 do { 2638 2780 if (pConn->file.fd < 0) 2639 2781 { … … 2674 2816 } while (0); 2675 2817 log("NdpFileWrite <%s> %lu %lu %d %d\n", pConn->file.fd < 0 ? "!null!" : pConn->file.fname, ulWrite, *pulActual, rc, pConn->rc); 2676 2818 2819 retry = ( rc == ERROR_INVALID_PARAMETER ) && !retry; 2820 } while( retry ); 2821 2677 2822 return rc; 2678 2823 }