• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

FFFTPのソースコードです。


Commit MetaInfo

Revisão588770f0bf195f785550d1066c747839530d2d24 (tree)
Hora2012-01-26 12:37:07
AutorYuji Tanaka <chibi_honu@user...>
CommiterYuji Tanaka

Mensagem de Log

Fix bugs of InitCmd and simultaneous connection.

Mudança Sumário

Diff

--- a/common.h
+++ b/common.h
@@ -1599,7 +1599,9 @@ int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size, int *CancelCheckWork);
15991599 // 同時接続対応
16001600 //int DoMDTM(char *Path, FILETIME *Time);
16011601 int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork);
1602-int DoQUOTE(char *CmdStr);
1602+// 同時接続対応
1603+//int DoQUOTE(char *CmdStr);
1604+int DoQUOTE(SOCKET cSkt, char *CmdStr);
16031605 SOCKET DoClose(SOCKET Sock);
16041606 int DoQUIT(SOCKET ctrl_skt);
16051607 int DoDirListCmdSkt(char *AddOpt, char *Path, int Num, int *CancelCheckWork);
--- a/connect.c
+++ b/connect.c
@@ -57,7 +57,9 @@
5757 // 64ビット対応
5858 //static BOOL CALLBACK QuickConDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);
5959 static INT_PTR CALLBACK QuickConDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);
60-static int SendInitCommand(char *Cmd);
60+// 同時接続対応
61+//static int SendInitCommand(char *Cmd);
62+static int SendInitCommand(SOCKET Socket, char *Cmd);
6163 static void AskUseFireWall(char *Host, int *Fire, int *Pasv, int *List);
6264 static void SaveCurrentSetToHistory(void);
6365 static int ReConnectSkt(SOCKET *Skt);
@@ -238,7 +240,7 @@ void ConnectProc(int Type, int Num)
238240 DispWindowTitle();
239241 SoundPlay(SND_CONNECT);
240242
241- SendInitCommand(CurHost.InitCmd);
243+ SendInitCommand(CmdCtrlSocket, CurHost.InitCmd);
242244
243245 if(strlen(CurHost.LocalInitDir) > 0)
244246 {
@@ -609,7 +611,7 @@ void HistoryConnectProc(int MenuCmd)
609611 DispWindowTitle();
610612 SoundPlay(SND_CONNECT);
611613
612- SendInitCommand(CurHost.InitCmd);
614+ SendInitCommand(CmdCtrlSocket, CurHost.InitCmd);
613615
614616 DoLocalCWD(CurHost.LocalInitDir);
615617 GetLocalDirForWnd();
@@ -648,7 +650,7 @@ void HistoryConnectProc(int MenuCmd)
648650 * cmd1\r\ncmd2\r\n\0
649651 *----------------------------------------------------------------------------*/
650652
651-static int SendInitCommand(char *Cmd)
653+static int SendInitCommand(SOCKET Socket, char *Cmd)
652654 {
653655 char Tmp[INITCMD_LEN+1];
654656 char *Pos;
@@ -659,7 +661,7 @@ static int SendInitCommand(char *Cmd)
659661 if((Pos = strchr(Tmp, '\r')) != NULL)
660662 *Pos = NUL;
661663 if(strlen(Tmp) > 0)
662- DoQUOTE(Tmp);
664+ DoQUOTE(Socket, Tmp);
663665
664666 if((Cmd = strchr(Cmd, '\n')) != NULL)
665667 Cmd++;
@@ -1106,7 +1108,7 @@ int ReConnectTrnSkt(SOCKET *Skt, int *CancelCheckWork)
11061108 // if((*Skt = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)
11071109 if((*Skt = DoConnect(&HostData, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, CancelCheckWork)) != INVALID_SOCKET)
11081110 {
1109- SendInitCommand(CurHost.InitCmd);
1111+ SendInitCommand(*Skt, CurHost.InitCmd);
11101112 // AskRemoteCurDir(Path, FMAX_PATH);
11111113 // DoCWD(Path, YES, YES, YES);
11121114 Sts = FFFTP_SUCCESS;
@@ -1148,7 +1150,7 @@ static int ReConnectSkt(SOCKET *Skt)
11481150 // if((*Skt = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)
11491151 if((*Skt = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, &CancelFlg)) != INVALID_SOCKET)
11501152 {
1151- SendInitCommand(CurHost.InitCmd);
1153+ SendInitCommand(*Skt, CurHost.InitCmd);
11521154 AskRemoteCurDir(Path, FMAX_PATH);
11531155 DoCWD(Path, YES, YES, YES);
11541156 Sts = FFFTP_SUCCESS;
@@ -1358,6 +1360,13 @@ int AskRealHostType(void)
13581360
13591361 int SetOSS(int wkOss)
13601362 {
1363+ if(Oss != wkOss) {
1364+ if (wkOss == YES) {
1365+ strcpy(CurHost.InitCmd, "OSS");
1366+ } else {
1367+ strcpy(CurHost.InitCmd, "GUARDIAN");
1368+ }
1369+ }
13611370 Oss = wkOss;
13621371 return(Oss);
13631372 }
--- a/ftpproc.c
+++ b/ftpproc.c
@@ -3073,7 +3073,9 @@ void SomeCmdProc(void)
30733073
30743074 if(InputDialogBox(somecmd_dlg, GetMainHwnd(), NULL, Cmd, 81, &Tmp, IDH_HELP_TOPIC_0000023) == YES)
30753075 {
3076- DoQUOTE(Cmd);
3076+ // 同時接続対応
3077+ //DoQUOTE(Cmd);
3078+ DoQUOTE(AskCmdCtrlSkt(), Cmd);
30773079 }
30783080 EnableUserOpe();
30793081 }
--- a/remote.c
+++ b/remote.c
@@ -468,11 +468,14 @@ int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork)
468468 * int 応答コードの1桁目
469469 *----------------------------------------------------------------------------*/
470470
471-int DoQUOTE(char *CmdStr)
471+// 同時接続対応
472+//int DoQUOTE(char *CmdStr)
473+int DoQUOTE(SOCKET cSkt, char *CmdStr)
472474 {
473- int Sts;
475+ int Sts, CancelCheckWork;
474476
475- Sts = CommandProcCmd(NULL, "%s", CmdStr);
477+ CancelCheckWork = NO;
478+ Sts = CommandProcTrn(cSkt, NULL, &CancelCheckWork, "%s", CmdStr);
476479
477480 if(Sts/100 >= FTP_CONTINUE)
478481 SoundPlay(SND_ERROR);
@@ -701,10 +704,10 @@ void SwitchOSSProc(void)
701704
702705 /* DoPWD でノード名の \ を保存するために OSSフラグも変更する */
703706 if(AskOSS() == YES) {
704- DoQUOTE("GUARDIAN");
707+ DoQUOTE(AskCmdCtrlSkt(), "GUARDIAN");
705708 SetOSS(NO);
706709 } else {
707- DoQUOTE("OSS");
710+ DoQUOTE(AskCmdCtrlSkt(), "OSS");
708711 SetOSS(YES);
709712 }
710713 /* Current Dir 再取得 */
@@ -721,7 +724,9 @@ void SwitchOSSProc(void)
721724 /*----- リモート側へコマンドを送りリプライを待つ(転送ソケット)---------------
722725 *
723726 * Parameter
727+* SOCKET cSkt : ソケット
724728 * char *Reply : リプライのコピー先 (NULL=コピーしない)
729+* int *CancelCheckWork :
725730 * char *fmt : フォーマット文字列
726731 * ... : パラメータ
727732 *