FFFTPのソースコードです。
修订版 | c16fea1548774bded6901c861158d9e648582259 (tree) |
---|---|
时间 | 2012-05-21 23:11:57 |
作者 | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Add routines for checking capability of MDTM and MFMT.
@@ -938,6 +938,10 @@ LIST_UNIX_70 | ||
938 | 938 | // IPv6対応 |
939 | 939 | #define FEATURE_EPRT 0x00000004 |
940 | 940 | #define FEATURE_EPSV 0x00000008 |
941 | +// ホスト側の日時取得 | |
942 | +#define FEATURE_MDTM 0x00000010 | |
943 | +// ホスト側の日時設定 | |
944 | +#define FEATURE_MFMT 0x00000020 | |
941 | 945 | |
942 | 946 | // IPv6対応 |
943 | 947 | #define NTYPE_AUTO 0 /* 自動 */ |
@@ -1773,6 +1773,12 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char | ||
1773 | 1773 | // IPv6対応 |
1774 | 1774 | if(strstr(Reply, " EPRT ") || strstr(Reply, " EPSV ")) |
1775 | 1775 | HostData->Feature |= FEATURE_EPRT | FEATURE_EPSV; |
1776 | + // ホスト側の日時取得 | |
1777 | + if(strstr(Reply, " MDTM ")) | |
1778 | + HostData->Feature |= FEATURE_MDTM; | |
1779 | + // ホスト側の日時設定 | |
1780 | + if(strstr(Reply, " MFMT ")) | |
1781 | + HostData->Feature |= FEATURE_MFMT; | |
1776 | 1782 | } |
1777 | 1783 | // UTF-8対応 |
1778 | 1784 | if(HostData->CurNameKanjiCode == KANJI_AUTO && (HostData->Feature & FEATURE_UTF8)) |
@@ -441,8 +441,11 @@ int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork) | ||
441 | 441 | Time->dwHighDateTime = 0; |
442 | 442 | |
443 | 443 | // 同時接続対応 |
444 | + // ホスト側の日時取得 | |
444 | 445 | // Sts = CommandProcTrn(Tmp, "MDTM %s", Path); |
445 | - Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "MDTM %s", Path); | |
446 | + Sts = 500; | |
447 | + if(AskHostFeature() & FEATURE_MDTM) | |
448 | + Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "MDTM %s", Path); | |
446 | 449 | if(Sts/100 == FTP_COMPLETE) |
447 | 450 | { |
448 | 451 | sTime.wMilliseconds = 0; |
@@ -469,7 +472,9 @@ int DoMFMT(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork) | ||
469 | 472 | |
470 | 473 | FileTimeToSystemTime(Time, &sTime); |
471 | 474 | |
472 | - Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "MFMT %04d%02d%02d%02d%02d%02d %s", sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, Path); | |
475 | + Sts = 500; | |
476 | + if(AskHostFeature() & FEATURE_MFMT) | |
477 | + Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "MFMT %04d%02d%02d%02d%02d%02d %s", sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, Path); | |
473 | 478 | return(Sts/100); |
474 | 479 | } |
475 | 480 |