• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FFFTPのソースコードです。


Commit MetaInfo

Revisionb25718f200a2ea7a8af5ba1476a2b3c3b7cff401 (tree)
Zeit2014-12-06 14:02:17
Autors_kawamoto <s_kawamoto@user...>
Commiters_kawamoto

Log Message

Add options to control the behavior of mirroring transfer.

Ändern Zusammenfassung

Diff

Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
--- a/Resource/FFFTP.rc
+++ b/Resource/FFFTP.rc
@@ -929,6 +929,7 @@ BEGIN
929929 CONTROL "ミラーリングアップロードでファイル削除前に確認(&U)",MIRROR_UPDEL_NOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,111,174,10
930930 CONTROL "ミラーリングダウンロードでファイル削除前に確認(&D)",MIRROR_DOWNDEL_NOTIFY,
931931 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,125,174,10
932+ CONTROL "ミラーリングでファイル内容を転送しない(&F)",MIRROR_NO_TRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,139,174,10
932933 END
933934
934935 somecmd_dlg DIALOG 0, 0, 187, 61
@@ -1111,11 +1112,12 @@ FONT 9, "MS Shell Dlg", 0, 0, 0x0
11111112 BEGIN
11121113 LTEXT "次のファイルを転送/削除します。",-1,7,6,160,8
11131114 LISTBOX MIRROR_LIST,7,16,160,78,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
1115+ CONTROL "ファイル内容を転送しない(&F)",MIRROR_NO_TRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,98,10
11141116 DEFPUSHBUTTON "実行",IDOK,7,153,50,14
11151117 PUSHBUTTON "キャンセル",IDCANCEL,62,153,50,14
11161118 SCROLLBAR MIRROR_SIZEGRIP,164,158,10,13,SBS_BOTTOMALIGN | SBS_VERT | SBS_SIZEGRIP
11171119 PUSHBUTTON "ヘルプ",9,117,153,50,14
1118- PUSHBUTTON "選んだ処理をしない",MIRROR_DEL,96,96,71,14,NOT WS_TABSTOP
1120+ PUSHBUTTON "一覧から削除",MIRROR_DEL,111,96,56,14,NOT WS_TABSTOP
11191121 LTEXT "",MIRROR_COPYNUM,7,115,160,8
11201122 LTEXT "",MIRROR_MAKENUM,7,126,160,8
11211123 LTEXT "",MIRROR_DELNUM,7,137,160,8
@@ -1126,8 +1128,9 @@ STYLE DS_LOCALEDIT | DS_SETFONT | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_S
11261128 CAPTION "ミラーリングダウンロード"
11271129 FONT 9, "MS Shell Dlg"
11281130 BEGIN
1129- LTEXT "次の処理を行います。",-1,7,6,92,8
1131+ LTEXT "次のファイルを転送/削除します。",-1,7,6,160,8
11301132 LISTBOX MIRROR_LIST,7,16,160,78,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
1133+ CONTROL "ファイル内容を転送しない(&F)",MIRROR_NO_TRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,98,10
11311134 DEFPUSHBUTTON "実行",IDOK,7,153,50,14
11321135 PUSHBUTTON "キャンセル",IDCANCEL,62,153,50,14
11331136 SCROLLBAR MIRROR_SIZEGRIP,164,158,10,13,SBS_BOTTOMALIGN | SBS_VERT | SBS_SIZEGRIP
@@ -2223,7 +2226,7 @@ VS_VERSION_INFO VERSIONINFO
22232226 BEGIN
22242227 BLOCK "StringFileInfo"
22252228 BEGIN
2226- BLOCK "041104b0"
2229+ BLOCK "080004b0"
22272230 BEGIN
22282231 VALUE "Comments", "これはフリーソフトウエアです。"
22292232 VALUE "CompanyName", "Sota, FFFTP Project"
@@ -2238,7 +2241,7 @@ BEGIN
22382241 END
22392242 BLOCK "VarFileInfo"
22402243 BEGIN
2241- VALUE "Translation", 0x411, 1200
2244+ VALUE "Translation", 0x800, 1200
22422245 END
22432246 END
22442247
--- a/Resource/resource.h
+++ b/Resource/resource.h
@@ -470,6 +470,7 @@
470470 #define HSET_NO_WEAK 1226
471471 #define HOST_SET_DEFAULT 1227
472472 #define TRMODE_LISTERROR 1228
473+#define MIRROR_NO_TRANSFER 1229
473474 #define MENU_END 40001
474475 #define MENU_EXIT 40001
475476 #define MENU_CONNECT 40003
@@ -662,7 +663,7 @@
662663 #ifndef APSTUDIO_READONLY_SYMBOLS
663664 #define _APS_NEXT_RESOURCE_VALUE 199
664665 #define _APS_NEXT_COMMAND_VALUE 40182
665-#define _APS_NEXT_CONTROL_VALUE 1229
666+#define _APS_NEXT_CONTROL_VALUE 1230
666667 #define _APS_NEXT_SYMED_VALUE 101
667668 #endif
668669 #endif
--- a/Resource_eng/ffftp.rc
+++ b/Resource_eng/ffftp.rc
@@ -948,6 +948,8 @@ BEGIN
948948 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,111,174,10
949949 CONTROL "Confirm deletions during Mirror &Download",MIRROR_DOWNDEL_NOTIFY,
950950 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,125,174,10
951+ CONTROL "Do not transfer &file contents during Mirroring",MIRROR_NO_TRANSFER,
952+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,139,174,10
951953 END
952954
953955 somecmd_dlg DIALOG 0, 0, 187, 61
@@ -1142,6 +1144,7 @@ FONT 9, "MS Shell Dlg"
11421144 BEGIN
11431145 LTEXT "Copy/Delete following files",-1,7,6,160,8
11441146 LISTBOX MIRROR_LIST,7,16,160,78,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
1147+ CONTROL "Do not transfer &file contents",MIRROR_NO_TRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,98,10
11451148 DEFPUSHBUTTON "Start Now",IDOK,7,153,50,14
11461149 PUSHBUTTON "Cancel",IDCANCEL,62,153,50,14
11471150 SCROLLBAR MIRROR_SIZEGRIP,164,158,10,13,SBS_BOTTOMALIGN | SBS_VERT | SBS_SIZEGRIP
@@ -1157,8 +1160,9 @@ STYLE DS_LOCALEDIT | DS_SETFONT | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_S
11571160 CAPTION "Mirror Download"
11581161 FONT 9, "MS Shell Dlg"
11591162 BEGIN
1160- LTEXT "Copy/Delete following files",-1,7,6,92,8
1163+ LTEXT "Copy/Delete following files",-1,7,6,160,8
11611164 LISTBOX MIRROR_LIST,7,16,160,78,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
1165+ CONTROL "Do not transfer &file contents",MIRROR_NO_TRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,98,10
11621166 DEFPUSHBUTTON "Start Now",IDOK,7,153,50,14
11631167 PUSHBUTTON "Cancel",IDCANCEL,62,153,50,14
11641168 SCROLLBAR MIRROR_SIZEGRIP,164,158,10,13,SBS_BOTTOMALIGN | SBS_VERT | SBS_SIZEGRIP
@@ -2259,7 +2263,7 @@ VS_VERSION_INFO VERSIONINFO
22592263 BEGIN
22602264 BLOCK "StringFileInfo"
22612265 BEGIN
2262- BLOCK "041104b0"
2266+ BLOCK "040904b0"
22632267 BEGIN
22642268 VALUE "Comments", "This software is Free Software"
22652269 VALUE "CompanyName", "Sota, FFFTP Project"
@@ -2274,7 +2278,7 @@ BEGIN
22742278 END
22752279 BLOCK "VarFileInfo"
22762280 BEGIN
2277- VALUE "Translation", 0x411, 1200
2281+ VALUE "Translation", 0x409, 1200
22782282 END
22792283 END
22802284
--- a/Resource_eng/resource.h
+++ b/Resource_eng/resource.h
@@ -1,6 +1,6 @@
11 //{{NO_DEPENDENCIES}}
22 // Microsoft Visual C++ generated include file.
3-// Used by FFFTP-eng.rc
3+// Used by ffftp.rc
44 //
55 #define DELETE_ALL 3
66 #define DELETE_NO 4
@@ -470,6 +470,7 @@
470470 #define HSET_NO_WEAK 1226
471471 #define HOST_SET_DEFAULT 1227
472472 #define TRMODE_LISTERROR 1228
473+#define MIRROR_NO_TRANSFER 1229
473474 #define MENU_END 40001
474475 #define MENU_EXIT 40001
475476 #define MENU_CONNECT 40003
@@ -662,7 +663,7 @@
662663 #ifndef APSTUDIO_READONLY_SYMBOLS
663664 #define _APS_NEXT_RESOURCE_VALUE 199
664665 #define _APS_NEXT_COMMAND_VALUE 40182
665-#define _APS_NEXT_CONTROL_VALUE 1229
666+#define _APS_NEXT_CONTROL_VALUE 1230
666667 #define _APS_NEXT_SYMED_VALUE 101
667668 #endif
668669 #endif
--- a/common.h
+++ b/common.h
@@ -1159,6 +1159,8 @@ typedef struct transpacket {
11591159 #endif
11601160 HWND hWndTrans; /* 転送中ダイアログのウインドウハンドル */
11611161 int Abort; /* 転送中止フラグ (ABORT_xxx) */
1162+ // ミラーリング設定追加
1163+ int NoTransfer;
11621164 // 同時接続対応
11631165 int ThreadCount;
11641166 struct transpacket *Next;
--- a/ftpproc.c
+++ b/ftpproc.c
@@ -112,6 +112,8 @@ extern int CancelFlg;
112112 extern int MakeAllDir;
113113 // ファイル一覧バグ修正
114114 extern int AbortOnListError;
115+// ミラーリング設定追加
116+extern int MirrorNoTransferContents;
115117
116118 /*===== ローカルなワーク =====*/
117119
@@ -688,6 +690,8 @@ void MirrorDownloadProc(int Notify)
688690 Pkt.KanjiCodeDesired = AskLocalKanjiCode();
689691 Pkt.KanaCnv = AskHostKanaCnv();
690692 Pkt.Mode = EXIST_OVW;
693+ // ミラーリング設定追加
694+ Pkt.NoTransfer = MirrorNoTransferContents;
691695 AddTmpTransFileList(&Pkt, &Base);
692696 }
693697 }
@@ -1693,6 +1697,8 @@ void MirrorUploadProc(int Notify)
16931697 }
16941698 #endif
16951699 Pkt.Mode = EXIST_OVW;
1700+ // ミラーリング設定追加
1701+ Pkt.NoTransfer = MirrorNoTransferContents;
16961702 AddTmpTransFileList(&Pkt, &Base);
16971703 }
16981704 }
@@ -1890,6 +1896,8 @@ static INT_PTR CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM
18901896 CountMirrorFiles(hDlg, *Base);
18911897 DlgSizeInit(hDlg, &DlgSize, &MirrorDlgSize);
18921898 EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), FALSE);
1899+ // ミラーリング設定追加
1900+ SendDlgItemMessage(hDlg, MIRROR_NO_TRANSFER, BM_SETCHECK, MirrorNoTransferContents, 0);
18931901 return(TRUE);
18941902
18951903 case WM_COMMAND :
@@ -1934,6 +1942,17 @@ static INT_PTR CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM
19341942 }
19351943 break;
19361944
1945+ // ミラーリング設定追加
1946+ case MIRROR_NO_TRANSFER :
1947+ Pos = *Base;
1948+ while(Pos != NULL)
1949+ {
1950+ if(strncmp(Pos->Cmd, "STOR", 4) == 0 || strncmp(Pos->Cmd, "RETR", 4) == 0)
1951+ Pos->NoTransfer = SendDlgItemMessage(hDlg, MIRROR_NO_TRANSFER, BM_GETCHECK, 0, 0);
1952+ Pos = Pos->Next;
1953+ }
1954+ break;
1955+
19371956 case IDHELP :
19381957 hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000012);
19391958 }
--- a/getput.c
+++ b/getput.c
@@ -84,6 +84,8 @@ static void DispTransPacket(TRANSPACKET *Pkt);
8484 static void EraseTransFileList(void);
8585 static ULONG WINAPI TransferThread(void *Dummy);
8686 static int MakeNonFullPath(TRANSPACKET *Pkt, char *CurDir, char *Tmp);
87+// ミラーリング設定追加
88+static int SetDownloadedFileTime(TRANSPACKET *Pkt);
8789 static int DownloadNonPassive(TRANSPACKET *Pkt, int *CancelCheckWork);
8890 static int DownloadPassive(TRANSPACKET *Pkt, int *CancelCheckWork);
8991 static int DownloadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *CancelCheckWork);
@@ -930,10 +932,20 @@ static ULONG WINAPI TransferThread(void *Dummy)
930932 // {
931933 // if(ReConnectTrnSkt() == FFFTP_SUCCESS)
932934 // DoDownload(AskTrnCtrlSkt(), TransPacketBase, NO, &Canceled);
935+ // ミラーリング設定追加
936+ if(Pos->NoTransfer == NO)
937+ {
933938 Sts = DoDownload(TrnSkt, Pos, NO, &Canceled[Pos->ThreadCount]) / 100;
934939 if(Sts != FTP_COMPLETE)
935940 LastError = YES;
936-// }
941+ }
942+
943+ // ミラーリング設定追加
944+ if((SaveTimeStamp == YES) &&
945+ ((Pos->Time.dwLowDateTime != 0) || (Pos->Time.dwHighDateTime != 0)))
946+ {
947+ SetDownloadedFileTime(Pos);
948+ }
937949 }
938950 }
939951 // 一部TYPE、STOR(RETR)、PORT(PASV)を並列に処理できないホストがあるため
@@ -954,10 +966,13 @@ static ULONG WINAPI TransferThread(void *Dummy)
954966 // {
955967 // if(ReConnectTrnSkt() == FFFTP_SUCCESS)
956968 // DoUpload(AskTrnCtrlSkt(), TransPacketBase);
969+ // ミラーリング設定追加
970+ if(Pos->NoTransfer == NO)
971+ {
957972 Sts = DoUpload(TrnSkt, Pos) / 100;
958973 if(Sts != FTP_COMPLETE)
959974 LastError = YES;
960-// }
975+ }
961976
962977 // ホスト側の日時設定
963978 /* ファイルのタイムスタンプを合わせる */
@@ -1347,6 +1362,21 @@ static int MakeNonFullPath(TRANSPACKET *Pkt, char *Cur, char *Tmp)
13471362
13481363
13491364
1365+// ミラーリング設定追加
1366+static int SetDownloadedFileTime(TRANSPACKET *Pkt)
1367+{
1368+ int Sts;
1369+ HANDLE hFile;
1370+ Sts = FFFTP_FAIL;
1371+ if((hFile = CreateFile(Pkt->LocalFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE)
1372+ {
1373+ if(SetFileTime(hFile, &Pkt->Time, &Pkt->Time, &Pkt->Time))
1374+ Sts = FFFTP_SUCCESS;
1375+ CloseHandle(hFile);
1376+ }
1377+ return Sts;
1378+}
1379+
13501380 /*----- ダウンロードを行なう --------------------------------------------------
13511381 *
13521382 * Parameter
@@ -2301,11 +2331,12 @@ static int DownloadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc
23012331 }
23022332
23032333 /* ファイルのタイムスタンプを合わせる */
2304- if((SaveTimeStamp == YES) &&
2305- ((Pkt->Time.dwLowDateTime != 0) || (Pkt->Time.dwHighDateTime != 0)))
2306- {
2307- SetFileTime(iFileHandle, &Pkt->Time, &Pkt->Time, &Pkt->Time);
2308- }
2334+ // ミラーリング設定追加
2335+// if((SaveTimeStamp == YES) &&
2336+// ((Pkt->Time.dwLowDateTime != 0) || (Pkt->Time.dwHighDateTime != 0)))
2337+// {
2338+// SetFileTime(iFileHandle, &Pkt->Time, &Pkt->Time, &Pkt->Time);
2339+// }
23092340
23102341 CloseHandle(iFileHandle);
23112342
--- a/main.c
+++ b/main.c
@@ -285,6 +285,8 @@ int AutoCheckForUptatesInterval = 7;
285285 time_t LastAutoCheckForUpdates = 0;
286286 // ファイル一覧バグ修正
287287 int AbortOnListError = YES;
288+// ミラーリング設定追加
289+int MirrorNoTransferContents = NO;
288290
289291
290292
--- a/option.c
+++ b/option.c
@@ -194,6 +194,8 @@ extern int AutoApplyUpdates;
194194 extern int AutoCheckForUptatesInterval;
195195 // ファイル一覧バグ修正
196196 extern int AbortOnListError;
197+// ミラーリング設定追加
198+extern int MirrorNoTransferContents;
197199
198200
199201 /*----- オプションのプロパティシート ------------------------------------------
@@ -1010,7 +1012,8 @@ static INT_PTR CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam
10101012 SetMultiTextToList(hDlg, MIRROR_NODEL_LIST, MirrorNoDel);
10111013 SendDlgItemMessage(hDlg, MIRROR_LOW, BM_SETCHECK, MirrorFnameCnv, 0);
10121014 SendDlgItemMessage(hDlg, MIRROR_UPDEL_NOTIFY, BM_SETCHECK, MirUpDelNotify, 0);
1013- SendDlgItemMessage(hDlg, MIRROR_DOWNDEL_NOTIFY, BM_SETCHECK, MirDownDelNotify, 0);
1015+ // ミラーリング設定追加
1016+ SendDlgItemMessage(hDlg, MIRROR_NO_TRANSFER, BM_SETCHECK, MirrorNoTransferContents, 0);
10141017 return(TRUE);
10151018
10161019 case WM_NOTIFY:
@@ -1023,6 +1026,8 @@ static INT_PTR CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam
10231026 MirrorFnameCnv = SendDlgItemMessage(hDlg, MIRROR_LOW, BM_GETCHECK, 0, 0);
10241027 MirUpDelNotify = SendDlgItemMessage(hDlg, MIRROR_UPDEL_NOTIFY, BM_GETCHECK, 0, 0);
10251028 MirDownDelNotify = SendDlgItemMessage(hDlg, MIRROR_DOWNDEL_NOTIFY, BM_GETCHECK, 0, 0);
1029+ // ミラーリング設定追加
1030+ MirrorNoTransferContents = SendDlgItemMessage(hDlg, MIRROR_NO_TRANSFER, BM_GETCHECK, 0, 0);
10261031 break;
10271032
10281033 case PSN_RESET :
--- a/registry.c
+++ b/registry.c
@@ -239,6 +239,8 @@ extern int AutoCheckForUptatesInterval;
239239 extern time_t LastAutoCheckForUpdates;
240240 // ファイル一覧バグ修正
241241 extern int AbortOnListError;
242+// ミラーリング設定追加
243+extern int MirrorNoTransferContents;
242244
243245 /*----- マスタパスワードの設定 ----------------------------------------------
244246 *
@@ -841,6 +843,8 @@ void SaveRegistry(void)
841843 WriteBinaryToReg(hKey4, "UpdLastCheck", &LastAutoCheckForUpdates, sizeof(LastAutoCheckForUpdates));
842844 // ファイル一覧バグ修正
843845 WriteIntValueToReg(hKey4, "AbortListErr", AbortOnListError);
846+ // ミラーリング設定追加
847+ WriteIntValueToReg(hKey4, "MirNoTransfer", MirrorNoTransferContents);
844848 }
845849 CloseSubKey(hKey4);
846850 }
@@ -1426,6 +1430,8 @@ int LoadRegistry(void)
14261430 ReadBinaryFromReg(hKey4, "UpdLastCheck", &LastAutoCheckForUpdates, sizeof(LastAutoCheckForUpdates));
14271431 // ファイル一覧バグ修正
14281432 ReadIntValueFromReg(hKey4, "AbortListErr", &AbortOnListError);
1433+ // ミラーリング設定追加
1434+ ReadIntValueFromReg(hKey4, "MirNoTransfer", &MirrorNoTransferContents);
14291435
14301436 CloseSubKey(hKey4);
14311437 }