• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

FFFTPのソースコードです。


Commit MetaInfo

Revision1be34e62758784330c25d54eac3d08f72fe649a5 (tree)
Zeit2016-12-10 17:41:20
Autors_kawamoto <s_kawamoto@user...>
Commiters_kawamoto

Log Message

Add options to ignore addresses returned by PASV.

Ändern Zusammenfassung

Diff

Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
Binary files a/FFFTP_Eng_Release_64/FFFTP.exe and b/FFFTP_Eng_Release_64/FFFTP.exe differ
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
Binary files a/Release_64/FFFTP.exe and b/Release_64/FFFTP.exe differ
--- a/Resource/FFFTP.rc
+++ b/Resource/FFFTP.rc
@@ -1400,14 +1400,15 @@ BEGIN
14001400 EDITTEXT HSET_THREAD_COUNT,72,8,17,12,ES_AUTOHSCROLL | ES_NUMBER
14011401 CONTROL "Spin1",HSET_THREAD_COUNT_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,89,7,9,14
14021402 LTEXT "(1`4)",-1,102,10,31,8
1403- CONTROL "ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚̃\ƒPƒbƒg‚ðÄ—˜—p(&S)",HSET_REUSE_SOCKET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,131,10
1404- LTEXT "Ú‘±ˆÛŽ—pƒRƒ}ƒ“ƒhŽüŠú(&K)",-1,7,44,84,8
1405- EDITTEXT HSET_NOOP_INTERVAL,92,42,17,12,ES_AUTOHSCROLL | ES_NUMBER
1406- CONTROL "Spin1",HSET_NOOP_INTERVAL_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,109,41,9,14
1407- LTEXT "(0`300•b; 0=–³Œø)",-1,122,44,76,8
1408- LTEXT "“]‘—ƒGƒ‰[Žž‚̏ˆ—(&E)",-1,7,61,81,8
1409- COMBOBOX HSET_ERROR_MODE,7,71,71,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
1410- CONTROL "“]‘—ƒGƒ‰[Œã‚ɍĐڑ±(&R)",HSET_ERROR_RECONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,71,102,10
1403+ CONTROL "ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚̃\ƒPƒbƒg‚ðÄ—˜—p(&S)",HSET_REUSE_SOCKET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,148,10
1404+ CONTROL "PASV‚Å•Ô‚³‚ê‚éƒAƒhƒŒƒX‚𖳎‹(&A)",HSET_NO_PASV_ADRS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,41,148,10
1405+ LTEXT "Ú‘±ˆÛŽ—pƒRƒ}ƒ“ƒhŽüŠú(&K)",-1,7,58,84,8
1406+ EDITTEXT HSET_NOOP_INTERVAL,92,56,17,12,ES_AUTOHSCROLL | ES_NUMBER
1407+ CONTROL "Spin1",HSET_NOOP_INTERVAL_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,109,55,9,14
1408+ LTEXT "(0`300•b; 0=–³Œø)",-1,122,58,76,8
1409+ LTEXT "“]‘—ƒGƒ‰[Žž‚̏ˆ—(&E)",-1,7,75,81,8
1410+ COMBOBOX HSET_ERROR_MODE,7,85,71,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
1411+ CONTROL "“]‘—ƒGƒ‰[Œã‚ɍĐڑ±(&R)",HSET_ERROR_RECONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,85,102,10
14111412 END
14121413
14131414 savecrypt_dlg DIALOG 0, 0, 146, 62
--- a/Resource/resource.h
+++ b/Resource/resource.h
@@ -472,6 +472,7 @@
472472 #define HOST_SET_DEFAULT 1227
473473 #define TRMODE_LISTERROR 1228
474474 #define MIRROR_NO_TRANSFER 1229
475+#define HSET_NO_PASV_ADRS 1230
475476 #define MENU_END 40001
476477 #define MENU_EXIT 40001
477478 #define MENU_CONNECT 40003
@@ -664,7 +665,7 @@
664665 #ifndef APSTUDIO_READONLY_SYMBOLS
665666 #define _APS_NEXT_RESOURCE_VALUE 199
666667 #define _APS_NEXT_COMMAND_VALUE 40182
667-#define _APS_NEXT_CONTROL_VALUE 1230
668+#define _APS_NEXT_CONTROL_VALUE 1231
668669 #define _APS_NEXT_SYMED_VALUE 101
669670 #endif
670671 #endif
--- a/Resource_eng/ffftp.rc
+++ b/Resource_eng/ffftp.rc
@@ -1440,14 +1440,16 @@ BEGIN
14401440 CONTROL "Spin1",HSET_THREAD_COUNT_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,89,7,9,14
14411441 LTEXT "(1 to 4 threads)",-1,102,10,53,8
14421442 CONTROL "Reuse &socket of the main window",HSET_REUSE_SOCKET,
1443- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,131,10
1444- LTEXT "Command for &Keep Alive",-1,7,44,84,8
1445- EDITTEXT HSET_NOOP_INTERVAL,92,42,17,12,ES_AUTOHSCROLL | ES_NUMBER
1446- CONTROL "Spin1",HSET_NOOP_INTERVAL_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,109,41,9,14
1447- LTEXT "(0 to 300sec; 0=Never)",-1,122,44,76,8
1448- LTEXT "When transfer &errors",-1,7,61,81,8
1449- COMBOBOX HSET_ERROR_MODE,7,71,71,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
1450- CONTROL "&Reconnect after errors",HSET_ERROR_RECONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,71,102,10
1443+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,148,10
1444+ CONTROL "Ignore &addresses returned by PASV",HSET_NO_PASV_ADRS,
1445+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,41,148,10
1446+ LTEXT "Command for &Keep Alive",-1,7,58,84,8
1447+ EDITTEXT HSET_NOOP_INTERVAL,92,56,17,12,ES_AUTOHSCROLL | ES_NUMBER
1448+ CONTROL "Spin1",HSET_NOOP_INTERVAL_SPN,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,109,55,9,14
1449+ LTEXT "(0 to 300sec; 0=Never)",-1,122,58,76,8
1450+ LTEXT "When transfer &errors",-1,7,75,81,8
1451+ COMBOBOX HSET_ERROR_MODE,7,85,71,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
1452+ CONTROL "&Reconnect after errors",HSET_ERROR_RECONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,85,102,10
14511453 END
14521454
14531455 savecrypt_dlg DIALOG 0, 0, 146, 62
--- a/Resource_eng/resource.h
+++ b/Resource_eng/resource.h
@@ -472,6 +472,7 @@
472472 #define HOST_SET_DEFAULT 1227
473473 #define TRMODE_LISTERROR 1228
474474 #define MIRROR_NO_TRANSFER 1229
475+#define HSET_NO_PASV_ADRS 1230
475476 #define MENU_END 40001
476477 #define MENU_EXIT 40001
477478 #define MENU_CONNECT 40003
@@ -664,7 +665,7 @@
664665 #ifndef APSTUDIO_READONLY_SYMBOLS
665666 #define _APS_NEXT_RESOURCE_VALUE 199
666667 #define _APS_NEXT_COMMAND_VALUE 40182
667-#define _APS_NEXT_CONTROL_VALUE 1230
668+#define _APS_NEXT_CONTROL_VALUE 1231
668669 #define _APS_NEXT_SYMED_VALUE 101
669670 #endif
670671 #endif
--- a/common.h
+++ b/common.h
@@ -76,8 +76,8 @@
7676 #else
7777 #define VER_STR "1.99a-20161113"
7878 #endif
79-#define VER_NUM 1990 /* 設定バージョン */
80-#define PROGRAM_VERSION_NUM 1990 /* バージョン */
79+#define VER_NUM 1991 /* 設定バージョン */
80+#define PROGRAM_VERSION_NUM 1991 /* バージョン */
8181 // ソフトウェア自動更新
8282 // リリースバージョンはリリース予定年(10進数4桁)+月(2桁)+日(2桁)+通し番号(0スタート2桁)とする
8383 // 2014年7月31日中の30個目のリリースは2014073129
@@ -1064,6 +1064,8 @@ typedef struct {
10641064 int TransferErrorNotify; /* 転送エラー時に確認ダイアログを出すかどうか (YES/NO) */
10651065 // セッションあたりの転送量制限対策
10661066 int TransferErrorReconnect; /* 転送エラー時に再接続する (YES/NO) */
1067+ // ホスト側の設定ミス対策
1068+ int NoPasvAdrs; /* PASVで返されるアドレスを無視する (YES/NO) */
10671069 } HOSTDATA;
10681070
10691071
@@ -1131,6 +1133,8 @@ typedef struct historydata {
11311133 int TransferErrorNotify; /* 転送エラー時に確認ダイアログを出すかどうか (YES/NO) */
11321134 // セッションあたりの転送量制限対策
11331135 int TransferErrorReconnect; /* 転送エラー時に再接続する (YES/NO) */
1136+ // ホスト側の設定ミス対策
1137+ int NoPasvAdrs; /* PASVで返されるアドレスを無視する (YES/NO) */
11341138 struct historydata *Next;
11351139 } HISTORYDATA;
11361140
@@ -1644,6 +1648,8 @@ int AskTransferErrorMode(void);
16441648 int AskTransferErrorNotify(void);
16451649 // セッションあたりの転送量制限対策
16461650 int AskErrorReconnect(void);
1651+// ホスト側の設定ミス対策
1652+int AskNoPasvAdrs(void);
16471653
16481654 /*===== cache.c =====*/
16491655
--- a/connect.c
+++ b/connect.c
@@ -3419,3 +3419,9 @@ int AskErrorReconnect(void)
34193419 return(CurHost.TransferErrorReconnect);
34203420 }
34213421
3422+// ホスト側の設定ミス対策
3423+int AskNoPasvAdrs(void)
3424+{
3425+ return(CurHost.NoPasvAdrs);
3426+}
3427+
--- a/getput.c
+++ b/getput.c
@@ -4109,6 +4109,8 @@ static int GetAdrsAndPortIPv4(SOCKET Skt, char *Str, char *Adrs, int *Port, int
41094109 // コンマではなくドットを返すホストがあるため
41104110 char *OldBtm;
41114111 int Sts;
4112+ // ホスト側の設定ミス対策
4113+ struct sockaddr_in SockAddr;
41124114
41134115 Sts = FFFTP_FAIL;
41144116
@@ -4151,9 +4153,21 @@ static int GetAdrsAndPortIPv4(SOCKET Skt, char *Str, char *Adrs, int *Port, int
41514153 {
41524154 if((Btm - Pos) <= Max)
41534155 {
4154- strncpy(Adrs, Pos, Btm - Pos);
4155- *(Adrs + (Btm - Pos)) = NUL;
4156- ReplaceAll(Adrs, ',', '.');
4156+ // ホスト側の設定ミス対策
4157+// strncpy(Adrs, Pos, Btm - Pos);
4158+// *(Adrs + (Btm - Pos)) = NUL;
4159+// ReplaceAll(Adrs, ',', '.');
4160+ if(AskNoPasvAdrs() == NO)
4161+ {
4162+ strncpy(Adrs, Pos, Btm - Pos);
4163+ *(Adrs + (Btm - Pos)) = NUL;
4164+ ReplaceAll(Adrs, ',', '.');
4165+ }
4166+ else
4167+ {
4168+ if(GetAsyncTableDataIPv4(Skt, &SockAddr, NULL) == YES)
4169+ AddressToStringIPv4(Adrs, &SockAddr.sin_addr);
4170+ }
41574171
41584172 Pos = Btm + 1;
41594173 Btm = strchr(Pos, ',');
@@ -4204,7 +4218,8 @@ static int GetAdrsAndPortIPv6(SOCKET Skt, char *Str, char *Adrs, int *Port, int
42044218 {
42054219 if((Btm - Pos) <= Max)
42064220 {
4207- if((Btm - Pos) > 0)
4221+ // ホスト側の設定ミス対策
4222+ if(AskNoPasvAdrs() == NO && (Btm - Pos) > 0)
42084223 {
42094224 strncpy(Adrs, Pos, Btm - Pos);
42104225 *(Adrs + (Btm - Pos)) = NUL;
--- a/history.c
+++ b/history.c
@@ -247,6 +247,8 @@ static void CopyHostToHistory(HOSTDATA *Host, HISTORYDATA *New)
247247 New->TransferErrorNotify = Host->TransferErrorNotify;
248248 // セッションあたりの転送量制限対策
249249 New->TransferErrorReconnect = Host->TransferErrorReconnect;
250+ // ホスト側の設定ミス対策
251+ New->NoPasvAdrs = Host->NoPasvAdrs;
250252 return;
251253 }
252254
@@ -317,6 +319,8 @@ void CopyHistoryToHost(HISTORYDATA *Hist, HOSTDATA *Host)
317319 Host->TransferErrorNotify = Hist->TransferErrorNotify;
318320 // セッションあたりの転送量制限対策
319321 Host->TransferErrorReconnect = Hist->TransferErrorReconnect;
322+ // ホスト側の設定ミス対策
323+ Host->NoPasvAdrs = Hist->NoPasvAdrs;
320324 return;
321325 }
322326
--- a/hostman.c
+++ b/hostman.c
@@ -1088,6 +1088,8 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
10881088 Set->TransferErrorNotify = Pos->Set.TransferErrorNotify;
10891089 // セッションあたりの転送量制限対策
10901090 Set->TransferErrorReconnect = Pos->Set.TransferErrorReconnect;
1091+ // ホスト側の設定ミス対策
1092+ Set->NoPasvAdrs = Pos->Set.NoPasvAdrs;
10911093 Sts = FFFTP_SUCCESS;
10921094 }
10931095 return(Sts);
@@ -1447,6 +1449,8 @@ void CopyDefaultDefaultHost(HOSTDATA *Set)
14471449 Set->TransferErrorNotify = YES;
14481450 // セッションあたりの転送量制限対策
14491451 Set->TransferErrorReconnect = YES;
1452+ // ホスト側の設定ミス対策
1453+ Set->NoPasvAdrs = YES;
14501454 return;
14511455 }
14521456
@@ -2440,6 +2444,7 @@ static INT_PTR CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam,
24402444 else
24412445 SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 0, 0);
24422446 SendDlgItemMessage(hDlg, HSET_ERROR_RECONNECT, BM_SETCHECK, TmpHost.TransferErrorReconnect, 0);
2447+ SendDlgItemMessage(hDlg, HSET_NO_PASV_ADRS, BM_SETCHECK, TmpHost.NoPasvAdrs, 0);
24432448 return(TRUE);
24442449
24452450 case WM_NOTIFY:
@@ -2472,6 +2477,7 @@ static INT_PTR CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam,
24722477 break;
24732478 }
24742479 TmpHost.TransferErrorReconnect = SendDlgItemMessage(hDlg, HSET_ERROR_RECONNECT, BM_GETCHECK, 0, 0);
2480+ TmpHost.NoPasvAdrs = SendDlgItemMessage(hDlg, HSET_NO_PASV_ADRS, BM_GETCHECK, 0, 0);
24752481 Apply = YES;
24762482 break;
24772483
--- a/registry.c
+++ b/registry.c
@@ -658,6 +658,8 @@ void SaveRegistry(void)
658658 SaveIntNum(hKey5, "ErrNotify", Hist.TransferErrorNotify, DefaultHist.TransferErrorNotify);
659659 // セッションあたりの転送量制限対策
660660 SaveIntNum(hKey5, "ErrReconnect", Hist.TransferErrorReconnect, DefaultHist.TransferErrorReconnect);
661+ // ホスト側の設定ミス対策
662+ SaveIntNum(hKey5, "NoPasvAdrs", Hist.NoPasvAdrs, DefaultHist.NoPasvAdrs);
661663
662664 CloseSubKey(hKey5);
663665 n++;
@@ -731,6 +733,7 @@ void SaveRegistry(void)
731733 SaveIntNum(hKey5, "ErrMode", Host.TransferErrorMode, DefaultHost.TransferErrorMode);
732734 SaveIntNum(hKey5, "ErrNotify", Host.TransferErrorNotify, DefaultHost.TransferErrorNotify);
733735 SaveIntNum(hKey5, "ErrReconnect", Host.TransferErrorReconnect, DefaultHost.TransferErrorReconnect);
736+ SaveIntNum(hKey5, "NoPasvAdrs", Host.NoPasvAdrs, DefaultHost.NoPasvAdrs);
734737 CloseSubKey(hKey5);
735738 }
736739
@@ -808,6 +811,8 @@ void SaveRegistry(void)
808811 SaveIntNum(hKey5, "ErrNotify", Host.TransferErrorNotify, DefaultHost.TransferErrorNotify);
809812 // セッションあたりの転送量制限対策
810813 SaveIntNum(hKey5, "ErrReconnect", Host.TransferErrorReconnect, DefaultHost.TransferErrorReconnect);
814+ // ホスト側の設定ミス対策
815+ SaveIntNum(hKey5, "NoPasvAdrs", Host.NoPasvAdrs, DefaultHost.NoPasvAdrs);
811816 }
812817 CloseSubKey(hKey5);
813818 }
@@ -1239,6 +1244,8 @@ int LoadRegistry(void)
12391244 ReadIntValueFromReg(hKey5, "ErrNotify", &Hist.TransferErrorNotify);
12401245 // セッションあたりの転送量制限対策
12411246 ReadIntValueFromReg(hKey5, "ErrReconnect", &Hist.TransferErrorReconnect);
1247+ // ホスト側の設定ミス対策
1248+ ReadIntValueFromReg(hKey5, "NoPasvAdrs", &Hist.NoPasvAdrs);
12421249
12431250 CloseSubKey(hKey5);
12441251 AddHistoryToHistory(&Hist);
@@ -1305,6 +1312,7 @@ int LoadRegistry(void)
13051312 ReadIntValueFromReg(hKey5, "ErrMode", &Host.TransferErrorMode);
13061313 ReadIntValueFromReg(hKey5, "ErrNotify", &Host.TransferErrorNotify);
13071314 ReadIntValueFromReg(hKey5, "ErrReconnect", &Host.TransferErrorReconnect);
1315+ ReadIntValueFromReg(hKey5, "NoPasvAdrs", &Host.NoPasvAdrs);
13081316
13091317 CloseSubKey(hKey5);
13101318
@@ -1410,6 +1418,8 @@ int LoadRegistry(void)
14101418 ReadIntValueFromReg(hKey5, "ErrNotify", &Host.TransferErrorNotify);
14111419 // セッションあたりの転送量制限対策
14121420 ReadIntValueFromReg(hKey5, "ErrReconnect", &Host.TransferErrorReconnect);
1421+ // ホスト側の設定ミス対策
1422+ ReadIntValueFromReg(hKey5, "NoPasvAdrs", &Host.NoPasvAdrs);
14131423
14141424 CloseSubKey(hKey5);
14151425