OSDN Git Service

Enhanced routine for simultaneous connection and canceling or aborting.
authors_kawamoto <s_kawamoto@users.sourceforge.jp>
Mon, 31 Oct 2011 15:35:39 +0000 (00:35 +0900)
committers_kawamoto <s_kawamoto@users.sourceforge.jp>
Mon, 31 Oct 2011 15:35:39 +0000 (00:35 +0900)
12 files changed:
FFFTP_Eng_Release/FFFTP.exe
Release/FFFTP.exe
common.h
connect.c
ftpproc.c
getput.c
main.c
remote.c
socket.c
socketwrapper.c
socketwrapper.h
toolmenu.c

index 3b28086..6b67a07 100644 (file)
Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
index 1322a36..7a679ed 100644 (file)
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
index beea818..c6b80e7 100644 (file)
--- a/common.h
+++ b/common.h
@@ -1233,8 +1233,8 @@ int BackgrndMessageProc(void);
 void ResetAutoExitFlg(void);\r
 int AskAutoExit(void);\r
 // 暗号化通信対応\r
-BOOL __stdcall SSLTimeoutCallback();\r
-BOOL __stdcall SSLConfirmCallback(BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName);\r
+BOOL __stdcall SSLTimeoutCallback(BOOL* pbAborted);\r
+BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName);\r
 \r
 /*===== filelist.c =====*/\r
 \r
@@ -1395,7 +1395,7 @@ void SaveCurrentSetToHost(void);
 int ReConnectCmdSkt(void);\r
 // int ReConnectTrnSkt(void);\r
 // 同時接続対応\r
-int ReConnectTrnSkt(SOCKET *Skt);\r
+int ReConnectTrnSkt(SOCKET *Skt, int *CancelCheckWork);\r
 SOCKET AskCmdCtrlSkt(void);\r
 SOCKET AskTrnCtrlSkt(void);\r
 void SktShareProh(void);\r
@@ -1406,7 +1406,9 @@ int AskConnecting(void);
 SOCKET connectsock(char *host, int port, char *PreMsg, int *CancelCheckWork);\r
 SOCKET GetFTPListenSocket(SOCKET ctrl_skt, int *CancelCheckWork);\r
 int AskTryingConnect(void);\r
-int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data);\r
+// 同時接続対応\r
+//int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data);\r
+int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data, int *CancelCheckWork);\r
 // 暗号化通信対応\r
 int AskCryptMode(void);\r
 int AskUseNoEncryption(void);\r
@@ -1462,7 +1464,9 @@ void SomeCmdProc(void);
 void CalcFileSizeProc(void);\r
 void DispCWDerror(HWND hWnd);\r
 void CopyURLtoClipBoard(void);\r
-int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type);\r
+// 同時接続対応\r
+//int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type);\r
+int ProcForNonFullpath(SOCKET cSkt, char *Path, char *CurDir, HWND hWnd, int *CancelCheckWork);\r
 void ReformToVMSstyleDirName(char *Path);\r
 void ReformToVMSstylePathName(char *Path);\r
 #if defined(HAVE_OPENVMS)\r
@@ -1493,9 +1497,10 @@ int DoRENAME(char *Src, char *Dst);
 int DoCHMOD(char *Path, char *Mode);\r
 // 同時接続対応\r
 //int DoSIZE(char *Path, LONGLONG *Size);\r
+int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size, int *CancelCheckWork);\r
+// 同時接続対応\r
 //int DoMDTM(char *Path, FILETIME *Time);\r
-int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size);\r
-int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time);\r
+int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork);\r
 int DoQUOTE(char *CmdStr);\r
 SOCKET DoClose(SOCKET Sock);\r
 int DoQUIT(SOCKET ctrl_skt);\r
@@ -1503,7 +1508,7 @@ int DoDirListCmdSkt(char *AddOpt, char *Path, int Num, int *CancelCheckWork);
 int CommandProcCmd(char *Reply, char *fmt, ...);\r
 // 同時接続対応\r
 //int CommandProcTrn(char *Reply, char *fmt, ...);\r
-int CommandProcTrn(SOCKET cSkt, char *Reply, char *fmt, ...);\r
+int CommandProcTrn(SOCKET cSkt, char *Reply, int* CancelCheckWork, char *fmt, ...);\r
 int command(SOCKET cSkt, char *Reply, int *CancelCheckWork, char *fmt, ...);\r
 int SendData(SOCKET Skt, char *Data, int Size, int Mode, int *CancelCheckWork);\r
 int ReadReplyMessage(SOCKET cSkt, char *Buf, int Max, int *CancelCheckWork, char *Tmp);\r
index 904fd0d..1aef250 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -58,15 +58,20 @@ static void AskUseFireWall(char *Host, int *Fire, int *Pasv, int *List);
 static void SaveCurrentSetToHistory(void);\r
 static int ReConnectSkt(SOCKET *Skt);\r
 // 暗号化通信対応\r
+// 同時接続対応\r
 //static SOCKET DoConnect(char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security);\r
-static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security);\r
-static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security);\r
+static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security, int *CancelCheckWork);\r
+static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security, int *CancelCheckWork);\r
 static int CheckOneTimePassword(char *Pass, char *Reply, int Type);\r
 static BOOL CALLBACK BlkHookFnc(void);\r
 static int Socks5MakeCmdPacket(SOCKS5REQUEST *Packet, char Cmd, int ValidIP, ulong IP, char *Host, ushort Port);\r
 static int SocksSendCmd(SOCKET Socket, void *Data, int Size, int *CancelCheckWork);\r
-static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet);\r
-static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet);\r
+// 同時接続対応\r
+//static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet);\r
+static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet, int *CancelCheckWork);\r
+// 同時接続対応\r
+//static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet);\r
+static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet, int *CancelCheckWork);\r
 static int Socks5SelMethod(SOCKET Socket, int *CancelCheckWork);\r
 \r
 /*===== 外部参照 =====*/\r
@@ -163,8 +168,9 @@ void ConnectProc(int Type, int Num)
 \r
                        DisableUserOpe();\r
                        // 暗号化通信対応\r
+                       // 同時接続対応\r
 //                     CmdCtrlSocket = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, Save, CurHost.Security);\r
-                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, Save, CurHost.Security);\r
+                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, Save, CurHost.Security, &CancelFlg);\r
                        TrnCtrlSocket = CmdCtrlSocket;\r
 \r
                        if(CmdCtrlSocket != INVALID_SOCKET)\r
@@ -244,8 +250,9 @@ void QuickConnectProc(void)
 \r
                        DisableUserOpe();\r
                        // 暗号化通信対応\r
+                       // 同時接続対応\r
 //                     CmdCtrlSocket = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
-                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
+                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, &CancelFlg);\r
                        TrnCtrlSocket = CmdCtrlSocket;\r
 \r
                        if(CmdCtrlSocket != INVALID_SOCKET)\r
@@ -418,8 +425,9 @@ void DirectConnectProc(char *unc, int Kanji, int Kana, int Fkanji, int TrMode)
 \r
                DisableUserOpe();\r
                // 暗号化通信対応\r
+               // 同時接続対応\r
 //             CmdCtrlSocket = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
-               CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
+               CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, &CancelFlg);\r
                TrnCtrlSocket = CmdCtrlSocket;\r
 \r
                if(CmdCtrlSocket != INVALID_SOCKET)\r
@@ -496,8 +504,9 @@ void HistoryConnectProc(int MenuCmd)
 \r
                        DisableUserOpe();\r
                        // 暗号化通信対応\r
+                       // 同時接続対応\r
 //                     CmdCtrlSocket = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
-                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security);\r
+                       CmdCtrlSocket = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, &CancelFlg);\r
                        TrnCtrlSocket = CmdCtrlSocket;\r
 \r
                        if(CmdCtrlSocket != INVALID_SOCKET)\r
@@ -958,7 +967,7 @@ int ReConnectCmdSkt(void)
 //     return(ReConnectSkt(&TrnCtrlSocket));\r
 //}\r
 // 同時接続対応\r
-int ReConnectTrnSkt(SOCKET *Skt)\r
+int ReConnectTrnSkt(SOCKET *Skt, int *CancelCheckWork)\r
 {\r
 //     char Path[FMAX_PATH+1];\r
        int Sts;\r
@@ -984,8 +993,10 @@ int ReConnectTrnSkt(SOCKET *Skt)
                HostData.UseFTPIS = NO;\r
        if(HostData.CryptMode != CRYPT_SFTP)\r
                HostData.UseSFTP = NO;\r
+       // 暗号化通信対応\r
+       // 同時接続対応\r
 //     if((*Skt = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)\r
-       if((*Skt = DoConnect(&HostData, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)\r
+       if((*Skt = DoConnect(&HostData, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, CancelCheckWork)) != INVALID_SOCKET)\r
        {\r
 //             AskRemoteCurDir(Path, FMAX_PATH);\r
 //             DoCWD(Path, YES, YES, YES);\r
@@ -1024,8 +1035,9 @@ static int ReConnectSkt(SOCKET *Skt)
                do_closesocket(*Skt);\r
        /* 再接続 */\r
        // 暗号化通信対応\r
+       // 同時接続対応\r
 //     if((*Skt = DoConnect(CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)\r
-       if((*Skt = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security)) != INVALID_SOCKET)\r
+       if((*Skt = DoConnect(&CurHost, CurHost.HostAdrs, CurHost.UserName, CurHost.PassWord, CurHost.Account, CurHost.Port, CurHost.FireWall, NO, CurHost.Security, &CancelFlg)) != INVALID_SOCKET)\r
        {\r
                AskRemoteCurDir(Path, FMAX_PATH);\r
                DoCWD(Path, YES, YES, YES);\r
@@ -1235,7 +1247,7 @@ int AskConnecting(void)
 *----------------------------------------------------------------------------*/\r
 \r
 // 暗号化通信対応\r
-static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security)\r
+static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security, int *CancelCheckWork)\r
 {\r
        int Sts;\r
        int Flg;\r
@@ -1282,7 +1294,9 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
 \r
                if(strlen(Tmp) != 0)\r
                {\r
-                       if((ContSock = connectsock(Tmp, Port, "", &CancelFlg)) != INVALID_SOCKET)\r
+                       // 同時接続対応\r
+//                     if((ContSock = connectsock(Tmp, Port, "", &CancelFlg)) != INVALID_SOCKET)\r
+                       if((ContSock = connectsock(Tmp, Port, "", CancelCheckWork)) != INVALID_SOCKET)\r
                        {\r
                                // バッファを無効\r
 #ifdef DISABLE_CONTROL_NETWORK_BUFFERS\r
@@ -1295,9 +1309,9 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
 //                                     ;\r
                                if(CryptMode == CRYPT_FTPIS)\r
                                {\r
-                                       if(AttachSSL(ContSock, INVALID_SOCKET))\r
+                                       if(AttachSSL(ContSock, INVALID_SOCKET, CancelCheckWork))\r
                                        {\r
-                                               while((Sts = ReadReplyMessage(ContSock, Buf, 1024, &CancelFlg, TmpBuf) / 100) == FTP_PRELIM)\r
+                                               while((Sts = ReadReplyMessage(ContSock, Buf, 1024, CancelCheckWork, TmpBuf) / 100) == FTP_PRELIM)\r
                                                        ;\r
                                        }\r
                                        else\r
@@ -1305,7 +1319,7 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                }\r
                                else\r
                                {\r
-                                       while((Sts = ReadReplyMessage(ContSock, Buf, 1024, &CancelFlg, TmpBuf) / 100) == FTP_PRELIM)\r
+                                       while((Sts = ReadReplyMessage(ContSock, Buf, 1024, CancelCheckWork, TmpBuf) / 100) == FTP_PRELIM)\r
                                                ;\r
                                }\r
 \r
@@ -1335,15 +1349,21 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                           (Fwall == FWALL_FU_FP_USER) ||\r
                                           (Fwall == FWALL_FU_FP))\r
                                        {\r
-                                               if((Sts = command(ContSock, Reply, &CancelFlg, "USER %s", FwallUser) / 100) == FTP_CONTINUE)\r
+                                               // 同時接続対応\r
+//                                             if((Sts = command(ContSock, Reply, &CancelFlg, "USER %s", FwallUser) / 100) == FTP_CONTINUE)\r
+                                               if((Sts = command(ContSock, Reply, CancelCheckWork, "USER %s", FwallUser) / 100) == FTP_CONTINUE)\r
                                                {\r
                                                        CheckOneTimePassword(FwallPass, Reply, FwallSecurity);\r
-                                                       Sts = command(ContSock, NULL, &CancelFlg, "PASS %s", Reply) / 100;\r
+                                                       // 同時接続対応\r
+//                                                     Sts = command(ContSock, NULL, &CancelFlg, "PASS %s", Reply) / 100;\r
+                                                       Sts = command(ContSock, NULL, CancelCheckWork, "PASS %s", Reply) / 100;\r
                                                }\r
                                        }\r
                                        else if(Fwall == FWALL_SIDEWINDER)\r
                                        {\r
-                                               Sts = command(ContSock, Reply, &CancelFlg, "USER %s:%s%c%s", FwallUser, FwallPass, FwallDelimiter, Host) / 100;\r
+                                               // 同時接続対応\r
+//                                             Sts = command(ContSock, Reply, &CancelFlg, "USER %s:%s%c%s", FwallUser, FwallPass, FwallDelimiter, Host) / 100;\r
+                                               Sts = command(ContSock, Reply, CancelCheckWork, "USER %s:%s%c%s", FwallUser, FwallPass, FwallDelimiter, Host) / 100;\r
                                        }\r
                                        if((Sts != FTP_COMPLETE) && (Sts != FTP_CONTINUE))\r
                                        {\r
@@ -1362,9 +1382,13 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                                                Flg++;\r
 \r
                                                        if(HostPort == PORT_NOR)\r
-                                                               Sts = command(ContSock, NULL, &CancelFlg, "%s %s", SiteTbl[Flg], Host) / 100;\r
+                                                               // 同時接続対応\r
+//                                                             Sts = command(ContSock, NULL, &CancelFlg, "%s %s", SiteTbl[Flg], Host) / 100;\r
+                                                               Sts = command(ContSock, NULL, CancelCheckWork, "%s %s", SiteTbl[Flg], Host) / 100;\r
                                                        else\r
-                                                               Sts = command(ContSock, NULL, &CancelFlg, "%s %s %d", SiteTbl[Flg], Host, HostPort) / 100;\r
+                                                               // 同時接続対応\r
+//                                                             Sts = command(ContSock, NULL, &CancelFlg, "%s %s %d", SiteTbl[Flg], Host, HostPort) / 100;\r
+                                                               Sts = command(ContSock, NULL, CancelCheckWork, "%s %s %d", SiteTbl[Flg], Host, HostPort) / 100;\r
                                                }\r
 \r
                                                if((Sts != FTP_COMPLETE) && (Sts != FTP_CONTINUE))\r
@@ -1398,13 +1422,13 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                                                // FTPES対応\r
                                                                if(CryptMode == CRYPT_FTPES)\r
                                                                {\r
-                                                                       if(IsOpenSSLLoaded() && (Sts = command(ContSock, Reply, &CancelFlg, "AUTH TLS")) == 234)\r
+                                                                       if(IsOpenSSLLoaded() && (Sts = command(ContSock, Reply, CancelCheckWork, "AUTH TLS")) == 234)\r
                                                                        {\r
-                                                                               if(AttachSSL(ContSock, INVALID_SOCKET))\r
+                                                                               if(AttachSSL(ContSock, INVALID_SOCKET, CancelCheckWork))\r
                                                                                {\r
-                                                                                       if((Sts = command(ContSock, Reply, &CancelFlg, "PBSZ 0")) == 200)\r
+                                                                                       if((Sts = command(ContSock, Reply, CancelCheckWork, "PBSZ 0")) == 200)\r
                                                                                        {\r
-                                                                                               if((Sts = command(ContSock, Reply, &CancelFlg, "PROT P")) == 200)\r
+                                                                                               if((Sts = command(ContSock, Reply, CancelCheckWork, "PROT P")) == 200)\r
                                                                                                {\r
                                                                                                }\r
                                                                                                else\r
@@ -1427,7 +1451,9 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                                                        if(Sts == FTP_ERROR)\r
                                                                                break;\r
                                                                        Continue = NO;\r
-                                                                       if((Sts = command(ContSock, Reply, &CancelFlg, "USER %s", Buf) / 100) == FTP_CONTINUE)\r
+                                                                       // 同時接続対応\r
+//                                                                     if((Sts = command(ContSock, Reply, &CancelFlg, "USER %s", Buf) / 100) == FTP_CONTINUE)\r
+                                                                       if((Sts = command(ContSock, Reply, CancelCheckWork, "USER %s", Buf) / 100) == FTP_CONTINUE)\r
                                                                        {\r
                                                                                if((strlen(Pass) != 0) || \r
                                                                                   (InputDialogBox(passwd_dlg, GetMainHwnd(), NULL, Pass, PASSWORD_LEN+1, &Anony, IDH_HELP_TOPIC_0000001) == YES))\r
@@ -1438,7 +1464,9 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                                                                        if(strcmp(Reply, " ") == 0)\r
                                                                                                strcpy(Reply, "");\r
 \r
-                                                                                       Sts = command(ContSock, NULL, &CancelFlg, "PASS %s", Reply) / 100;\r
+                                                                                       // 同時接続対応\r
+//                                                                                     Sts = command(ContSock, NULL, &CancelFlg, "PASS %s", Reply) / 100;\r
+                                                                                       Sts = command(ContSock, NULL, CancelCheckWork, "PASS %s", Reply) / 100;\r
                                                                                        if(Sts == FTP_ERROR)\r
                                                                                        {\r
                                                                                                strcpy(Pass, "");\r
@@ -1453,7 +1481,9 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                                                                                                if((strlen(Acct) != 0) || \r
                                                                                                   (InputDialogBox(account_dlg, GetMainHwnd(), NULL, Acct, ACCOUNT_LEN+1, &Anony, IDH_HELP_TOPIC_0000001) == YES))\r
                                                                                                {\r
-                                                                                                       Sts = command(ContSock, NULL, &CancelFlg, "ACCT %s", Acct) / 100;\r
+                                                                                                       // 同時接続対応\r
+//                                                                                                     Sts = command(ContSock, NULL, &CancelFlg, "ACCT %s", Acct) / 100;\r
+                                                                                                       Sts = command(ContSock, NULL, CancelCheckWork, "ACCT %s", Acct) / 100;\r
                                                                                                }\r
                                                                                                else\r
                                                                                                        DoPrintf("No account specified");\r
@@ -1516,7 +1546,7 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                // ホストの機能を確認\r
                if(ContSock != INVALID_SOCKET)\r
                {\r
-                       if((Sts = command(ContSock, Reply, &CancelFlg, "FEAT")) == 211)\r
+                       if((Sts = command(ContSock, Reply, CancelCheckWork, "FEAT")) == 211)\r
                        {\r
                                // 改行文字はReadReplyMessageで消去されるため区切り文字に空白を使用\r
                                // UTF-8対応\r
@@ -1532,7 +1562,7 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                        // UTF-8対応\r
                        if(HostData->NameKanjiCode == KANJI_AUTO && (HostData->Feature & FEATURE_UTF8))\r
                        {\r
-                               if((Sts = command(ContSock, Reply, &CancelFlg, "OPTS UTF8 ON")) == 200)\r
+                               if((Sts = command(ContSock, Reply, CancelCheckWork, "OPTS UTF8 ON")) == 200)\r
                                {\r
                                }\r
                        }\r
@@ -1545,33 +1575,35 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
        return(ContSock);\r
 }\r
 \r
-static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security)\r
+// 同時接続対応\r
+//static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security)\r
+static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass, char *Acct, int Port, int Fwall, int SavePass, int Security, int *CancelCheckWork)\r
 {\r
        SOCKET ContSock;\r
        ContSock = INVALID_SOCKET;\r
-       CancelFlg = NO;\r
-       if(CancelFlg == NO && ContSock == INVALID_SOCKET && HostData->UseSFTP == YES)\r
+       *CancelCheckWork = NO;\r
+       if(*CancelCheckWork == NO && ContSock == INVALID_SOCKET && HostData->UseSFTP == YES)\r
        {\r
                SetTaskMsg(MSGJPN317);\r
-               if((ContSock = DoConnectCrypt(CRYPT_SFTP, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security)) != INVALID_SOCKET)\r
+               if((ContSock = DoConnectCrypt(CRYPT_SFTP, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security, CancelCheckWork)) != INVALID_SOCKET)\r
                        HostData->CryptMode = CRYPT_SFTP;\r
        }\r
-       if(CancelFlg == NO && ContSock == INVALID_SOCKET && HostData->UseFTPIS == YES)\r
+       if(*CancelCheckWork == NO && ContSock == INVALID_SOCKET && HostData->UseFTPIS == YES)\r
        {\r
                SetTaskMsg(MSGJPN316);\r
-               if((ContSock = DoConnectCrypt(CRYPT_FTPIS, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security)) != INVALID_SOCKET)\r
+               if((ContSock = DoConnectCrypt(CRYPT_FTPIS, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security, CancelCheckWork)) != INVALID_SOCKET)\r
                        HostData->CryptMode = CRYPT_FTPIS;\r
        }\r
-       if(CancelFlg == NO && ContSock == INVALID_SOCKET && HostData->UseFTPES == YES)\r
+       if(*CancelCheckWork == NO && ContSock == INVALID_SOCKET && HostData->UseFTPES == YES)\r
        {\r
                SetTaskMsg(MSGJPN315);\r
-               if((ContSock = DoConnectCrypt(CRYPT_FTPES, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security)) != INVALID_SOCKET)\r
+               if((ContSock = DoConnectCrypt(CRYPT_FTPES, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security, CancelCheckWork)) != INVALID_SOCKET)\r
                        HostData->CryptMode = CRYPT_FTPES;\r
        }\r
-       if(CancelFlg == NO && ContSock == INVALID_SOCKET && HostData->UseNoEncryption == YES)\r
+       if(*CancelCheckWork == NO && ContSock == INVALID_SOCKET && HostData->UseNoEncryption == YES)\r
        {\r
                SetTaskMsg(MSGJPN314);\r
-               if((ContSock = DoConnectCrypt(CRYPT_NONE, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security)) != INVALID_SOCKET)\r
+               if((ContSock = DoConnectCrypt(CRYPT_NONE, HostData, Host, User, Pass, Acct, Port, Fwall, SavePass, Security, CancelCheckWork)) != INVALID_SOCKET)\r
                        HostData->CryptMode = CRYPT_NONE;\r
        }\r
        return ContSock;\r
@@ -1822,8 +1854,12 @@ SOCKET connectsock(char *host, int port, char *PreMsg, int *CancelCheckWork)
                        if(Fwall == FWALL_SOCKS4)\r
                        {\r
                                Socks4Reply.Result = -1;\r
+                               // 同時接続対応\r
+//                             if((SocksSendCmd(sSocket, &Socks4Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//                                (Socks4GetCmdReply(sSocket, &Socks4Reply) != FFFTP_SUCCESS) || \r
+//                                (Socks4Reply.Result != SOCKS4_RES_OK))\r
                                if((SocksSendCmd(sSocket, &Socks4Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-                                  (Socks4GetCmdReply(sSocket, &Socks4Reply) != FFFTP_SUCCESS) || \r
+                                  (Socks4GetCmdReply(sSocket, &Socks4Reply, CancelCheckWork) != FFFTP_SUCCESS) || \r
                                   (Socks4Reply.Result != SOCKS4_RES_OK))\r
                                {\r
                                        SetTaskMsg(MSGJPN023, Socks4Reply.Result);\r
@@ -1840,8 +1876,12 @@ SOCKET connectsock(char *host, int port, char *PreMsg, int *CancelCheckWork)
                                }\r
 \r
                                Socks5Reply.Result = -1;\r
+                               // 同時接続対応\r
+//                             if((SocksSendCmd(sSocket, &Socks5Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//                                (Socks5GetCmdReply(sSocket, &Socks5Reply) != FFFTP_SUCCESS) || \r
+//                                (Socks5Reply.Result != SOCKS5_RES_OK))\r
                                if((SocksSendCmd(sSocket, &Socks5Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-                                  (Socks5GetCmdReply(sSocket, &Socks5Reply) != FFFTP_SUCCESS) || \r
+                                  (Socks5GetCmdReply(sSocket, &Socks5Reply, CancelCheckWork) != FFFTP_SUCCESS) || \r
                                   (Socks5Reply.Result != SOCKS5_RES_OK))\r
                                {\r
                                        SetTaskMsg(MSGJPN024, Socks5Reply.Result);\r
@@ -1913,8 +1953,12 @@ SOCKET GetFTPListenSocket(SOCKET ctrl_skt, int *CancelCheckWork)
                                Len = offsetof(SOCKS4CMD, UserID) + strlen(FwallUser) + 1;\r
 \r
                                Socks4Reply.Result = -1;\r
+                               // 同時接続対応\r
+//                             if((SocksSendCmd(listen_skt, &Socks4Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//                                (Socks4GetCmdReply(listen_skt, &Socks4Reply) != FFFTP_SUCCESS) || \r
+//                                (Socks4Reply.Result != SOCKS4_RES_OK))\r
                                if((SocksSendCmd(listen_skt, &Socks4Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-                                  (Socks4GetCmdReply(listen_skt, &Socks4Reply) != FFFTP_SUCCESS) || \r
+                                  (Socks4GetCmdReply(listen_skt, &Socks4Reply, CancelCheckWork) != FFFTP_SUCCESS) || \r
                                   (Socks4Reply.Result != SOCKS4_RES_OK))\r
                                {\r
                                        SetTaskMsg(MSGJPN028, Socks4Reply.Result);\r
@@ -1945,8 +1989,12 @@ SOCKET GetFTPListenSocket(SOCKET ctrl_skt, int *CancelCheckWork)
                                Len = Socks5MakeCmdPacket(&Socks5Cmd, SOCKS5_CMD_BIND, UseIPadrs, CurSockAddr.sin_addr.s_addr, DomainName, CurSockAddr.sin_port);\r
 \r
                                Socks5Reply.Result = -1;\r
+                               // 同時接続対応\r
+//                             if((SocksSendCmd(listen_skt, &Socks5Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//                                (Socks5GetCmdReply(listen_skt, &Socks5Reply) != FFFTP_SUCCESS) || \r
+//                                (Socks5Reply.Result != SOCKS5_RES_OK))\r
                                if((SocksSendCmd(listen_skt, &Socks5Cmd, Len, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-                                  (Socks5GetCmdReply(listen_skt, &Socks5Reply) != FFFTP_SUCCESS) || \r
+                                  (Socks5GetCmdReply(listen_skt, &Socks5Reply, CancelCheckWork) != FFFTP_SUCCESS) || \r
                                   (Socks5Reply.Result != SOCKS5_RES_OK))\r
                                {\r
                                        SetTaskMsg(MSGJPN029, Socks5Reply.Result);\r
@@ -2014,7 +2062,11 @@ SOCKET GetFTPListenSocket(SOCKET ctrl_skt, int *CancelCheckWork)
        if(listen_skt != INVALID_SOCKET)\r
        {\r
 #define  UC(b)  (((int)b)&0xff)\r
-               if((command(ctrl_skt,NULL, &CancelFlg, "PORT %d,%d,%d,%d,%d,%d",\r
+               // 同時接続対応\r
+//             if((command(ctrl_skt,NULL, &CancelFlg, "PORT %d,%d,%d,%d,%d,%d",\r
+//                             UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]),\r
+//                             UC(p[0]), UC(p[1])) / 100) != FTP_COMPLETE)\r
+               if((command(ctrl_skt,NULL, CancelCheckWork, "PORT %d,%d,%d,%d,%d,%d",\r
                                UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]),\r
                                UC(p[0]), UC(p[1])) / 100) != FTP_COMPLETE)\r
                {\r
@@ -2157,7 +2209,9 @@ static int SocksSendCmd(SOCKET Socket, void *Data, int Size, int *CancelCheckWor
 *              int ステータス (FFFTP_SUCCESS/FFFTP_FAIL)\r
 *----------------------------------------------------------------------------*/\r
 \r
-static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)\r
+// 同時接続対応\r
+//static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)\r
+static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet, int *CancelCheckWork)\r
 {\r
        uchar *Pos;\r
        int Len;\r
@@ -2166,7 +2220,9 @@ static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)
        Pos = (uchar *)Packet;\r
        Pos += SOCKS5REPLY_SIZE;\r
 \r
-       if((Ret = ReadNchar(Socket, (char *)Packet, SOCKS5REPLY_SIZE, &CancelFlg)) == FFFTP_SUCCESS)\r
+       // 同時接続対応\r
+//     if((Ret = ReadNchar(Socket, (char *)Packet, SOCKS5REPLY_SIZE, &CancelFlg)) == FFFTP_SUCCESS)\r
+       if((Ret = ReadNchar(Socket, (char *)Packet, SOCKS5REPLY_SIZE, CancelCheckWork)) == FFFTP_SUCCESS)\r
        {\r
                if(Packet->Type == SOCKS5_ADRS_IPV4)\r
                        Len = 4 + 2;\r
@@ -2174,7 +2230,9 @@ static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)
                        Len = 6 + 2;\r
                else\r
                {\r
-                       if((Ret = ReadNchar(Socket, (char *)Pos, 1, &CancelFlg)) == FFFTP_SUCCESS)\r
+                       // 同時接続対応\r
+//                     if((Ret = ReadNchar(Socket, (char *)Pos, 1, &CancelFlg)) == FFFTP_SUCCESS)\r
+                       if((Ret = ReadNchar(Socket, (char *)Pos, 1, CancelCheckWork)) == FFFTP_SUCCESS)\r
                        {\r
                                Len = *Pos + 2;\r
                                Pos++;\r
@@ -2182,7 +2240,9 @@ static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)
                }\r
 \r
                if(Ret == FFFTP_SUCCESS)\r
-                       Ret = ReadNchar(Socket, (char *)Pos, Len, &CancelFlg);\r
+                       // 同時接続対応\r
+//                     Ret = ReadNchar(Socket, (char *)Pos, Len, &CancelFlg);\r
+                       Ret = ReadNchar(Socket, (char *)Pos, Len, CancelCheckWork);\r
        }\r
 \r
        if(Ret != FFFTP_SUCCESS)\r
@@ -2202,11 +2262,15 @@ static int Socks5GetCmdReply(SOCKET Socket, SOCKS5REPLY *Packet)
 *              int ステータス (FFFTP_SUCCESS/FFFTP_FAIL)\r
 *----------------------------------------------------------------------------*/\r
 \r
-static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet)\r
+// 同時接続対応\r
+//static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet)\r
+static int Socks4GetCmdReply(SOCKET Socket, SOCKS4REPLY *Packet, int *CancelCheckWork)\r
 {\r
        int Ret;\r
 \r
-       Ret = ReadNchar(Socket, (char *)Packet, SOCKS4REPLY_SIZE, &CancelFlg);\r
+       // 同時接続対応\r
+//     Ret = ReadNchar(Socket, (char *)Packet, SOCKS4REPLY_SIZE, &CancelFlg);\r
+       Ret = ReadNchar(Socket, (char *)Packet, SOCKS4REPLY_SIZE, CancelCheckWork);\r
 \r
        if(Ret != FFFTP_SUCCESS)\r
                DoPrintf(MSGJPN035);\r
@@ -2242,8 +2306,12 @@ static int Socks5SelMethod(SOCKET Socket, int *CancelCheckWork)
        else\r
                Socks5Method.Methods[0] = SOCKS5_AUTH_USER;\r
 \r
+       // 同時接続対応\r
+//     if((SocksSendCmd(Socket, &Socks5Method, SOCKS5METHODREQUEST_SIZE, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//        (ReadNchar(Socket, (char *)&Socks5MethodReply, SOCKS5METHODREPLY_SIZE, &CancelFlg) != FFFTP_SUCCESS) ||\r
+//        (Socks5MethodReply.Method == (uchar)0xFF))\r
        if((SocksSendCmd(Socket, &Socks5Method, SOCKS5METHODREQUEST_SIZE, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-          (ReadNchar(Socket, (char *)&Socks5MethodReply, SOCKS5METHODREPLY_SIZE, &CancelFlg) != FFFTP_SUCCESS) ||\r
+          (ReadNchar(Socket, (char *)&Socks5MethodReply, SOCKS5METHODREPLY_SIZE, CancelCheckWork) != FFFTP_SUCCESS) ||\r
           (Socks5MethodReply.Method == (uchar)0xFF))\r
        {\r
                SetTaskMsg(MSGJPN036);\r
@@ -2260,8 +2328,12 @@ static int Socks5SelMethod(SOCKET Socket, int *CancelCheckWork)
                Buf[2 + Len] = Len2;\r
                strcpy(Buf+3+Len, FwallPass);\r
 \r
+               // 同時接続対応\r
+//             if((SocksSendCmd(Socket, &Buf, Len+Len2+3, CancelCheckWork) != FFFTP_SUCCESS) ||\r
+//                (ReadNchar(Socket, (char *)&Socks5Status, SOCKS5USERPASSSTATUS_SIZE, &CancelFlg) != FFFTP_SUCCESS) ||\r
+//                (Socks5Status.Status != 0))\r
                if((SocksSendCmd(Socket, &Buf, Len+Len2+3, CancelCheckWork) != FFFTP_SUCCESS) ||\r
-                  (ReadNchar(Socket, (char *)&Socks5Status, SOCKS5USERPASSSTATUS_SIZE, &CancelFlg) != FFFTP_SUCCESS) ||\r
+                  (ReadNchar(Socket, (char *)&Socks5Status, SOCKS5USERPASSSTATUS_SIZE, CancelCheckWork) != FFFTP_SUCCESS) ||\r
                   (Socks5Status.Status != 0))\r
                {\r
                        SetTaskMsg(MSGJPN037);\r
@@ -2285,7 +2357,9 @@ static int Socks5SelMethod(SOCKET Socket, int *CancelCheckWork)
 *              int ステータス (FFFTP_SUCCESS/FFFTP_FAIL)\r
 *----------------------------------------------------------------------------*/\r
 \r
-int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data)\r
+// 同時接続対応\r
+//int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data)\r
+int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data, int *CancelCheckWork)\r
 {\r
        int Ret;\r
        char Buf[300];\r
@@ -2293,14 +2367,18 @@ int SocksGet2ndBindReply(SOCKET Socket, SOCKET *Data)
        Ret = FFFTP_FAIL;\r
        if((AskHostFireWall() == YES) && (FwallType == FWALL_SOCKS4))\r
        {\r
-               Socks4GetCmdReply(Socket, (SOCKS4REPLY *)Buf);\r
+               // 同時接続対応\r
+//             Socks4GetCmdReply(Socket, (SOCKS4REPLY *)Buf);\r
+               Socks4GetCmdReply(Socket, (SOCKS4REPLY *)Buf, CancelCheckWork);\r
                *Data = Socket;\r
                Ret = FFFTP_SUCCESS;\r
        }\r
        else if((AskHostFireWall() == YES) &&\r
                        ((FwallType == FWALL_SOCKS5_NOAUTH) || (FwallType == FWALL_SOCKS5_USER)))\r
        {\r
-               Socks5GetCmdReply(Socket, (SOCKS5REPLY *)Buf);\r
+               // 同時接続対応\r
+//             Socks5GetCmdReply(Socket, (SOCKS5REPLY *)Buf);\r
+               Socks5GetCmdReply(Socket, (SOCKS5REPLY *)Buf, CancelCheckWork);\r
                *Data = Socket;\r
                Ret = FFFTP_SUCCESS;\r
        }\r
index 09a5263..08bcc52 100644 (file)
--- a/ftpproc.c
+++ b/ftpproc.c
@@ -122,6 +122,9 @@ void DownLoadProc(int ChName, int ForceFile, int All)
        FILELIST *Pos;\r
        TRANSPACKET Pkt;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -253,6 +256,9 @@ void DirectDownLoadProc(char *Fname)
 {\r
        TRANSPACKET Pkt;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -392,6 +398,9 @@ void MirrorDownloadProc(int Notify)
        int Level;\r
        int Mode;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -863,6 +872,9 @@ void UpLoadListProc(int ChName, int All)
        char Tmp[FMAX_PATH+1];\r
        int FirstAdd;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -1031,6 +1043,9 @@ void UpLoadDragProc(WPARAM wParam)
        int FirstAdd;\r
        char Cur[FMAX_PATH+1];\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -1190,6 +1205,9 @@ void MirrorUploadProc(int Notify)
        FILETIME TmpFtimeL;\r
        FILETIME TmpFtimeR;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -1960,6 +1978,9 @@ void DeleteProc(void)
        char CurDir[FMAX_PATH+1];\r
        char Tmp[FMAX_PATH+1];\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        // デッドロック対策\r
        DisableUserOpe();\r
        Sts = YES;\r
@@ -2115,7 +2136,9 @@ static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDi
                else\r
                {\r
                        /* フルパスを使わない時のための処理 */\r
-                       if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FFFTP_FAIL)\r
+                       // 同時接続対応\r
+//                     if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FFFTP_FAIL)\r
+                       if(ProcForNonFullpath(AskCmdCtrlSkt(), Path, CurDir, GetMainHwnd(), &CancelFlg) == FFFTP_FAIL)\r
                                *Sw = NO_ALL;\r
 \r
                        if(*Sw != NO_ALL)\r
@@ -2199,6 +2222,9 @@ void RenameProc(void)
        int RenFlg;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        Sts = FFFTP_SUCCESS;\r
        if(GetFocus() == GetLocalHwnd())\r
                Win = WIN_LOCAL;\r
@@ -2274,6 +2300,9 @@ void MoveRemoteFileProc(int drop_index)
        int RenFlg;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(MoveMode == MOVE_DISABLE)\r
        {\r
                return;\r
@@ -2443,6 +2472,9 @@ void MkdirProc(void)
        char *Title;\r
        int Tmp;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetLocalHwnd())\r
        {\r
                Win = WIN_LOCAL;\r
@@ -2495,6 +2527,9 @@ void ChangeDirComboProc(HWND hWnd)
        char Tmp[FMAX_PATH+1];\r
        int i;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if((i = SendMessage(hWnd, CB_GETCURSEL, 0, 0)) != CB_ERR)\r
        {\r
                SendMessage(hWnd, CB_GETLBTEXT, i, (LPARAM)Tmp);\r
@@ -2536,6 +2571,9 @@ void ChangeDirBmarkProc(int MarkID)
        char Remote[FMAX_PATH+1];\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        Sts = AskBookMarkText(MarkID, Local, Remote, FMAX_PATH+1);\r
        if((Sts == BMARK_TYPE_LOCAL) || (Sts == BMARK_TYPE_BOTH))\r
        {\r
@@ -2575,6 +2613,9 @@ void ChangeDirDirectProc(int Win)
        char *Title;\r
        int Tmp;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(Win == WIN_LOCAL)\r
                Title = MSGJPN072;\r
        else\r
@@ -2651,6 +2692,9 @@ void ChmodProc(void)
        char *BufTmp;\r
        int BufLen;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetRemoteHwnd())\r
        {\r
                if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
@@ -2874,6 +2918,9 @@ void SomeCmdProc(void)
        int Tmp;\r
        FILELIST *FileListBase;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetRemoteHwnd())\r
        {\r
                if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
@@ -2918,6 +2965,9 @@ void CalcFileSizeProc(void)
        int All;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if((All = DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_notify_dlg), GetMainHwnd(), SizeNotifyDlgWndProc)) != NO_ALL)\r
        {\r
                Sts = FFFTP_SUCCESS;\r
@@ -3141,7 +3191,9 @@ void CopyURLtoClipBoard(void)
 *                      Path にファイル名のみ残す。(パス名は消す)\r
 *----------------------------------------------------------------------------*/\r
 \r
-int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)\r
+// 同時接続対応\r
+//int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)\r
+int ProcForNonFullpath(SOCKET cSkt, char *Path, char *CurDir, HWND hWnd, int *CancelCheckWork)\r
 {\r
        int Sts;\r
        int Cmd;\r
@@ -3163,12 +3215,12 @@ int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)
 \r
                if(strcmp(Tmp, CurDir) != 0)\r
                {\r
-                       if(Type == 0)\r
-                               Cmd = CommandProcCmd(NULL, "CWD %s", Tmp);\r
-                       else\r
-                               // 同時接続対応\r
+                       // 同時接続対応\r
+//                     if(Type == 0)\r
+//                             Cmd = CommandProcCmd(NULL, "CWD %s", Tmp);\r
+//                     else\r
 //                             Cmd = CommandProcTrn(NULL, "CWD %s", Tmp);\r
-                               Cmd = CommandProcTrn((SOCKET)(Type - 1), NULL, "CWD %s", Tmp);\r
+                       Cmd = CommandProcTrn(cSkt, NULL, CancelCheckWork, "CWD %s", Tmp);\r
 \r
                        if(Cmd/100 != FTP_COMPLETE)\r
                        {\r
index fdcfffa..2f0094a 100644 (file)
--- a/getput.c
+++ b/getput.c
@@ -96,7 +96,7 @@ static int UpLoadPassive(TRANSPACKET *Pkt);
 static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt);\r
 // 同時接続対応\r
 //static int TermCodeConvAndSend(TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii);\r
-static int TermCodeConvAndSend(int ThreadCount, TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii);\r
+static int TermCodeConvAndSend(TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii, int *CancelCheckWork);\r
 static void DispUploadFinishMsg(TRANSPACKET *Pkt, int iRetCode);\r
 static int SetUploadResume(TRANSPACKET *Pkt, int ProcMode, LONGLONG Size, int *Mode);\r
 static LRESULT CALLBACK TransDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);\r
@@ -142,7 +142,9 @@ static time_t TimeStart[MAX_DATA_CONNECTION];       /* 転送開始時間 */
 static int KeepDlg = NO;       /* 転送中ダイアログを消さないかどうか (YES/NO) */\r
 static int MoveToForeground = NO;              /* ウインドウを前面に移動するかどうか (YES/NO) */\r
 \r
-static char CurDir[FMAX_PATH+1] = { "" };\r
+// 同時接続対応\r
+//static char CurDir[FMAX_PATH+1] = { "" };\r
+static char CurDir[MAX_DATA_CONNECTION][FMAX_PATH+1];\r
 // 同時接続対応\r
 //static char ErrMsg[ERR_MSG_LEN+7];\r
 static char ErrMsg[MAX_DATA_CONNECTION+1][ERR_MSG_LEN+7];\r
@@ -627,7 +629,11 @@ void GoForwardTransWindow(void)
 \r
 void InitTransCurDir(void)\r
 {\r
-       strcpy(CurDir, "");\r
+       // 同時接続対応\r
+//     strcpy(CurDir, "");\r
+       int i;\r
+       for(i = 0; i < MAX_DATA_CONNECTION; i++)\r
+               strcpy(CurDir[i], "");\r
        return;\r
 }\r
 \r
@@ -710,7 +716,19 @@ static ULONG WINAPI TransferThread(void *Dummy)
                        if(TrnSkt == INVALID_SOCKET || NewCmdSkt != CmdSkt)\r
                        {\r
                                ReleaseMutex(hListAccMutex);\r
-                               ReConnectTrnSkt(&TrnSkt);\r
+                               ReConnectTrnSkt(&TrnSkt, &Canceled[ThreadCount]);\r
+                               // 同時ログイン数制限に引っかかった可能性あり\r
+                               // 負荷を下げるためにしばらく待機\r
+                               if(TrnSkt == INVALID_SOCKET)\r
+                               {\r
+                                       i = 10000;\r
+                                       while(NewCmdSkt != CmdSkt && i > 0)\r
+                                       {\r
+                                               BackgrndMessageProc();\r
+                                               Sleep(1);\r
+                                               i--;\r
+                                       }\r
+                               }\r
 //                             WaitForSingleObject(hListAccMutex, INFINITE);\r
                                while(WaitForSingleObject(hListAccMutex, 0) == WAIT_TIMEOUT)\r
                                {\r
@@ -793,7 +811,7 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                {\r
                                        /* フルパスを使わないための処理 */\r
 //                                     if(MakeNonFullPath(TransPacketBase, CurDir, Tmp) == FFFTP_SUCCESS)\r
-                                       if(MakeNonFullPath(Pos, CurDir, Tmp) == FFFTP_SUCCESS)\r
+                                       if(MakeNonFullPath(Pos, CurDir[Pos->ThreadCount], Tmp) == FFFTP_SUCCESS)\r
                                        {\r
 //                                             if(strncmp(TransPacketBase->Cmd, "RETR-S", 6) == 0)\r
                                                if(strncmp(Pos->Cmd, "RETR-S", 6) == 0)\r
@@ -802,8 +820,8 @@ static ULONG WINAPI TransferThread(void *Dummy)
 //                                                     DoSIZE(TransPacketBase->RemoteFile, &TransPacketBase->Size);\r
 //                                                     DoMDTM(TransPacketBase->RemoteFile, &TransPacketBase->Time);\r
 //                                                     strcpy(TransPacketBase->Cmd, "RETR ");\r
-                                                       DoSIZE(TrnSkt, Pos->RemoteFile, &Pos->Size);\r
-                                                       DoMDTM(TrnSkt, Pos->RemoteFile, &Pos->Time);\r
+                                                       DoSIZE(TrnSkt, Pos->RemoteFile, &Pos->Size, &Canceled[Pos->ThreadCount]);\r
+                                                       DoMDTM(TrnSkt, Pos->RemoteFile, &Pos->Time, &Canceled[Pos->ThreadCount]);\r
                                                        strcpy(Pos->Cmd, "RETR ");\r
                                                }\r
 \r
@@ -827,7 +845,7 @@ static ULONG WINAPI TransferThread(void *Dummy)
 //                             ReleaseMutex(hListAccMutex);\r
                                /* フルパスを使わないための処理 */\r
 //                             if(MakeNonFullPath(TransPacketBase, CurDir, Tmp) == FFFTP_SUCCESS)\r
-                               if(MakeNonFullPath(Pos, CurDir, Tmp) == FFFTP_SUCCESS)\r
+                               if(MakeNonFullPath(Pos, CurDir[Pos->ThreadCount], Tmp) == FFFTP_SUCCESS)\r
                                {\r
                                        Up = YES;\r
 //                                     if(DoUpLoad(AskTrnCtrlSkt(), TransPacketBase) == 429)\r
@@ -856,7 +874,7 @@ static ULONG WINAPI TransferThread(void *Dummy)
 //                                     strcpy(Tmp, TransPacketBase->RemoteFile);\r
                                        strcpy(Tmp, Pos->RemoteFile);\r
 //                                     if(ProcForNonFullpath(Tmp, CurDir, hWndTrans, 1) == FFFTP_FAIL)\r
-                                       if(ProcForNonFullpath(Tmp, CurDir, hWndTrans, (int)TrnSkt + 1) == FFFTP_FAIL)\r
+                                       if(ProcForNonFullpath(TrnSkt, Tmp, CurDir[Pos->ThreadCount], hWndTrans, &Canceled[Pos->ThreadCount]) == FFFTP_FAIL)\r
                                        {\r
                                                ClearAll = YES;\r
                                                CwdSts = FTP_ERROR;\r
@@ -866,13 +884,13 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                        {\r
                                                Up = YES;\r
 //                                             CommandProcTrn(NULL, "MKD %s", Tmp);\r
-                                               CommandProcTrn(TrnSkt, NULL, "MKD %s", Tmp);\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "MKD %s", Tmp);\r
                                                /* すでにフォルダがある場合もあるので、 */\r
                                                /* ここではエラーチェックはしない */\r
 \r
                                        if(FolderAttr)\r
 //                                             CommandProcTrn(NULL, "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, Tmp);\r
-                                               CommandProcTrn(TrnSkt, NULL, "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, Tmp);\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, Tmp);\r
                                        }\r
                                }\r
 //                             else if(strlen(TransPacketBase->LocalFile) > 0)\r
@@ -893,15 +911,15 @@ static ULONG WINAPI TransferThread(void *Dummy)
 \r
                                /* フルパスを使わないための処理 */\r
 //                             if(MakeNonFullPath(TransPacketBase, CurDir, Tmp) == FFFTP_SUCCESS)\r
-                               if(MakeNonFullPath(Pos, CurDir, Tmp) == FFFTP_SUCCESS)\r
+                               if(MakeNonFullPath(Pos, CurDir[Pos->ThreadCount], Tmp) == FFFTP_SUCCESS)\r
                                {\r
                                        Up = YES;\r
 //                                     CommandProcTrn(NULL, "%s%s", TransPacketBase->Cmd+2, TransPacketBase->RemoteFile);\r
-                                       CommandProcTrn(TrnSkt, NULL, "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
+                                       CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
 \r
                                        if(FolderAttr)\r
 //                                             CommandProcTrn(NULL, "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, TransPacketBase->RemoteFile);\r
-                                               CommandProcTrn(TrnSkt, NULL, "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, Pos->RemoteFile);\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "%s %03d %s", AskHostChmodCmd(), FolderAttrNum, Pos->RemoteFile);\r
                                }\r
                                ReleaseMutex(hListAccMutex);\r
                        }\r
@@ -918,11 +936,11 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                {\r
                                        /* フルパスを使わないための処理 */\r
 //                                     if(MakeNonFullPath(TransPacketBase, CurDir, Tmp) == FFFTP_SUCCESS)\r
-                                       if(MakeNonFullPath(Pos, CurDir, Tmp) == FFFTP_SUCCESS)\r
+                                       if(MakeNonFullPath(Pos, CurDir[Pos->ThreadCount], Tmp) == FFFTP_SUCCESS)\r
                                        {\r
                                                Up = YES;\r
 //                                             CommandProcTrn(NULL, "%s%s", TransPacketBase->Cmd+2, TransPacketBase->RemoteFile);\r
-                                               CommandProcTrn(TrnSkt, NULL, "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
                                        }\r
                                }\r
                                ReleaseMutex(hListAccMutex);\r
@@ -940,11 +958,11 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                {\r
                                        /* フルパスを使わないための処理 */\r
 //                                     if(MakeNonFullPath(TransPacketBase, CurDir, Tmp) == FFFTP_SUCCESS)\r
-                                       if(MakeNonFullPath(Pos, CurDir, Tmp) == FFFTP_SUCCESS)\r
+                                       if(MakeNonFullPath(Pos, CurDir[Pos->ThreadCount], Tmp) == FFFTP_SUCCESS)\r
                                        {\r
                                                Up = YES;\r
 //                                             CommandProcTrn(NULL, "%s%s", TransPacketBase->Cmd+2, TransPacketBase->RemoteFile);\r
-                                               CommandProcTrn(TrnSkt, NULL, "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "%s%s", Pos->Cmd+2, Pos->RemoteFile);\r
                                        }\r
                                }\r
                                ReleaseMutex(hListAccMutex);\r
@@ -1002,10 +1020,10 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                if(AskShareProh() == YES)\r
                                {\r
 //                                     if(strcmp(CurDir, TransPacketBase->RemoteFile) != 0)\r
-                                       if(strcmp(CurDir, Pos->RemoteFile) != 0)\r
+                                       if(strcmp(CurDir[Pos->ThreadCount], Pos->RemoteFile) != 0)\r
                                        {\r
 //                                             if(CommandProcTrn(NULL, "CWD %s", TransPacketBase->RemoteFile)/100 != FTP_COMPLETE)\r
-                                               if(CommandProcTrn(TrnSkt, NULL, "CWD %s", Pos->RemoteFile)/100 != FTP_COMPLETE)\r
+                                               if(CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "CWD %s", Pos->RemoteFile)/100 != FTP_COMPLETE)\r
                                                {\r
                                                        DispCWDerror(hWndTrans);\r
                                                        ClearAll = YES;\r
@@ -1013,7 +1031,7 @@ static ULONG WINAPI TransferThread(void *Dummy)
                                        }\r
                                }\r
 //                             strcpy(CurDir, TransPacketBase->RemoteFile);\r
-                               strcpy(CurDir, Pos->RemoteFile);\r
+                               strcpy(CurDir[Pos->ThreadCount], Pos->RemoteFile);\r
                                ReleaseMutex(hListAccMutex);\r
                        }\r
                        /* カレントディレクトリを戻す */\r
@@ -1025,9 +1043,9 @@ static ULONG WINAPI TransferThread(void *Dummy)
 //                                     if(strcmp(CurDir, TransPacketBase->RemoteFile) != 0)\r
 //                                             CommandProcTrn(NULL, "CWD %s", TransPacketBase->RemoteFile);\r
 //                                     strcpy(CurDir, TransPacketBase->RemoteFile);\r
-                                       if(strcmp(CurDir, Pos->RemoteFile) != 0)\r
-                                               CommandProcTrn(TrnSkt, NULL, "CWD %s", Pos->RemoteFile);\r
-                                       strcpy(CurDir, Pos->RemoteFile);\r
+                                       if(strcmp(CurDir[Pos->ThreadCount], Pos->RemoteFile) != 0)\r
+                                               CommandProcTrn(TrnSkt, NULL, &Canceled[Pos->ThreadCount], "CWD %s", Pos->RemoteFile);\r
+                                       strcpy(CurDir[Pos->ThreadCount], Pos->RemoteFile);\r
                                }\r
                                ReleaseMutex(hListAccMutex);\r
                        }\r
@@ -1182,7 +1200,7 @@ static int MakeNonFullPath(TRANSPACKET *Pkt, char *Cur, char *Tmp)
        int Sts;\r
 \r
 //     Sts = ProcForNonFullpath(Pkt->RemoteFile, Cur, Pkt->hWndTrans, 1);\r
-       Sts = ProcForNonFullpath(Pkt->RemoteFile, Cur, Pkt->hWndTrans, (int)Pkt->ctrl_skt + 1);\r
+       Sts = ProcForNonFullpath(Pkt->ctrl_skt, Pkt->RemoteFile, Cur, Pkt->hWndTrans, &Canceled[Pkt->ThreadCount]);\r
        if(Sts == FFFTP_FAIL)\r
                ClearAll = YES;\r
 \r
@@ -1290,7 +1308,9 @@ static int DownLoadNonPassive(TRANSPACKET *Pkt, int *CancelCheckWork)
                        iRetCode = command(Pkt->ctrl_skt, Reply, CancelCheckWork, "%s", Buf);\r
                        if(iRetCode/100 == FTP_PRELIM)\r
                        {\r
-                               if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
+                               // 同時接続対応\r
+//                             if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
+                               if(SocksGet2ndBindReply(listen_socket, &data_socket, CancelCheckWork) == FFFTP_FAIL)\r
                                {\r
                                        iLength = sizeof(saSockAddr1);\r
                                        data_socket = do_accept(listen_socket, (struct sockaddr *)&saSockAddr1, (int *)&iLength);\r
@@ -1317,7 +1337,7 @@ static int DownLoadNonPassive(TRANSPACKET *Pkt, int *CancelCheckWork)
 //                                     iRetCode = DownLoadFile(Pkt, data_socket, CreateMode, CancelCheckWork);\r
                                        if(IsSSLAttached(Pkt->ctrl_skt))\r
                                        {\r
-                                               if(AttachSSL(data_socket, Pkt->ctrl_skt))\r
+                                               if(AttachSSL(data_socket, Pkt->ctrl_skt, CancelCheckWork))\r
                                                        iRetCode = DownLoadFile(Pkt, data_socket, CreateMode, CancelCheckWork);\r
                                                else\r
                                                        iRetCode = 500;\r
@@ -1393,7 +1413,7 @@ static int DownLoadPassive(TRANSPACKET *Pkt, int *CancelCheckWork)
 //                                             iRetCode = DownLoadFile(Pkt, data_socket, CreateMode, CancelCheckWork);\r
                                                if(IsSSLAttached(Pkt->ctrl_skt))\r
                                                {\r
-                                                       if(AttachSSL(data_socket, Pkt->ctrl_skt))\r
+                                                       if(AttachSSL(data_socket, Pkt->ctrl_skt, CancelCheckWork))\r
                                                                iRetCode = DownLoadFile(Pkt, data_socket, CreateMode, CancelCheckWork);\r
                                                        else\r
                                                                iRetCode = 500;\r
@@ -2332,7 +2352,9 @@ static int UpLoadNonPassive(TRANSPACKET *Pkt)
                iRetCode = command(Pkt->ctrl_skt, Reply, &Canceled[Pkt->ThreadCount], "%s", Buf);\r
                if((iRetCode/100) == FTP_PRELIM)\r
                {\r
-                       if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
+                       // 同時接続対応\r
+//                     if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
+                       if(SocksGet2ndBindReply(listen_socket, &data_socket, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                        {\r
                                iLength=sizeof(saSockAddr1);\r
                                data_socket = do_accept(listen_socket,(struct sockaddr *)&saSockAddr1, (int *)&iLength);\r
@@ -2359,7 +2381,7 @@ static int UpLoadNonPassive(TRANSPACKET *Pkt)
 //                             iRetCode = UpLoadFile(Pkt, data_socket);\r
                                if(IsSSLAttached(Pkt->ctrl_skt))\r
                                {\r
-                                       if(AttachSSL(data_socket, Pkt->ctrl_skt))\r
+                                       if(AttachSSL(data_socket, Pkt->ctrl_skt, &Canceled[Pkt->ThreadCount]))\r
                                                iRetCode = UpLoadFile(Pkt, data_socket);\r
                                        else\r
                                                iRetCode = 500;\r
@@ -2441,7 +2463,7 @@ static int UpLoadPassive(TRANSPACKET *Pkt)
 //                                     iRetCode = UpLoadFile(Pkt, data_socket);\r
                                        if(IsSSLAttached(Pkt->ctrl_skt))\r
                                        {\r
-                                               if(AttachSSL(data_socket, Pkt->ctrl_skt))\r
+                                               if(AttachSSL(data_socket, Pkt->ctrl_skt, &Canceled[Pkt->ThreadCount]))\r
                                                        iRetCode = UpLoadFile(Pkt, data_socket);\r
                                                else\r
                                                        iRetCode = 500;\r
@@ -2784,7 +2806,7 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt)
                                        }\r
 \r
 //                                     if(TermCodeConvAndSend(&tInfo, dSkt, Buf2, cInfo.OutLen, Pkt->Type) == FFFTP_FAIL)\r
-                                       if(TermCodeConvAndSend(Pkt->ThreadCount, &tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type) == FFFTP_FAIL)\r
+                                       if(TermCodeConvAndSend(&tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                                        {\r
                                                Pkt->Abort = ABORT_ERROR;\r
                                                        break;\r
@@ -2796,7 +2818,7 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt)
                        {\r
                                // 同時接続対応\r
 //                             if(TermCodeConvAndSend(&tInfo, dSkt, Buf, iNumBytes, Pkt->Type) == FFFTP_FAIL)\r
-                               if(TermCodeConvAndSend(Pkt->ThreadCount, &tInfo, dSkt, Buf, iNumBytes, Pkt->Type) == FFFTP_FAIL)\r
+                               if(TermCodeConvAndSend(&tInfo, dSkt, Buf, iNumBytes, Pkt->Type, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                                        Pkt->Abort = ABORT_ERROR;\r
                        }\r
 \r
@@ -2940,12 +2962,12 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt)
                                }\r
 \r
 //                             if(TermCodeConvAndSend(&tInfo, dSkt, Buf2, cInfo.OutLen, Pkt->Type) == FFFTP_FAIL)\r
-                               if(TermCodeConvAndSend(Pkt->ThreadCount, &tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type) == FFFTP_FAIL)\r
+                               if(TermCodeConvAndSend(&tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                                        Pkt->Abort = ABORT_ERROR;\r
                                cInfo2.Buf = Buf3;\r
                                cInfo2.BufSize = (BUFSIZE + 3) * 4;\r
                                FlushRestData(&cInfo2);\r
-                               if(TermCodeConvAndSend(Pkt->ThreadCount, &tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type) == FFFTP_FAIL)\r
+                               if(TermCodeConvAndSend(&tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                                        Pkt->Abort = ABORT_ERROR;\r
                        }\r
 \r
@@ -3017,7 +3039,7 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt)
 \r
 // 同時接続対応\r
 //static int TermCodeConvAndSend(TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii)\r
-static int TermCodeConvAndSend(int ThreadCount, TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii)\r
+static int TermCodeConvAndSend(TERMCODECONVINFO *tInfo, SOCKET Skt, char *Data, int Size, int Ascii, int *CancelCheckWork)\r
 {\r
        char Buf3[BUFSIZE*2];\r
        int Continue;\r
@@ -3037,7 +3059,7 @@ static int TermCodeConvAndSend(int ThreadCount, TERMCODECONVINFO *tInfo, SOCKET
                        Continue = ConvTermCodeToCRLF(tInfo);\r
                        // 同時接続対応\r
 //                     if((Ret = SendData(Skt, Buf3, tInfo->OutLen, 0, &Canceled)) == FFFTP_FAIL)\r
-                       if((Ret = SendData(Skt, Buf3, tInfo->OutLen, 0, &Canceled[ThreadCount])) == FFFTP_FAIL)\r
+                       if((Ret = SendData(Skt, Buf3, tInfo->OutLen, 0, CancelCheckWork)) == FFFTP_FAIL)\r
                                break;\r
                }\r
                while(Continue == YES);\r
@@ -3045,7 +3067,7 @@ static int TermCodeConvAndSend(int ThreadCount, TERMCODECONVINFO *tInfo, SOCKET
        else\r
                // 同時接続対応\r
 //             Ret = SendData(Skt, Data, Size, 0, &Canceled);\r
-               Ret = SendData(Skt, Data, Size, 0, &Canceled[ThreadCount]);\r
+               Ret = SendData(Skt, Data, Size, 0, CancelCheckWork);\r
 \r
        return(Ret);\r
 }\r
diff --git a/main.c b/main.c
index 42a7534..ad6e890 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1081,12 +1081,16 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_FILTER :\r
+                                       // 同時接続対応\r
+                                       CancelFlg = NO;\r
                                        SetFilter(&CancelFlg);\r
                                        break;\r
 \r
                                case MENU_SORT :\r
                                        if(SortSetting() == YES)\r
                                        {\r
+                                               // 同時接続対応\r
+                                               CancelFlg = NO;\r
                                                LocalFileSort = AskSortType(ITEM_LFILE);\r
                                                LocalDirSort = AskSortType(ITEM_LDIR);\r
                                                RemoteFileSort = AskSortType(ITEM_RFILE);\r
@@ -1156,6 +1160,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_REFRESH :\r
+                                       // 同時接続対応\r
+                                       CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
                                        GetLocalDirForWnd();\r
                                        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
@@ -1180,6 +1186,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case REFRESH_REMOTE :\r
+                                       // 同時接続対応\r
+                                       CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
                                        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
                                                GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
@@ -1244,6 +1252,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_DOTFILE :\r
+                                       // 同時接続対応\r
+                                       CancelFlg = NO;\r
                                        DotFile ^= 1;\r
                                        DispDotFileMode();\r
                                        GetLocalDirForWnd();\r
@@ -1480,6 +1490,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                case LVN_COLUMNCLICK :\r
                                        if(((NMHDR *)lParam)->hwndFrom == GetLocalHwnd())\r
                                        {\r
+                                               // 同時接続対応\r
+                                               CancelFlg = NO;\r
                                                SetSortTypeByColumn(WIN_LOCAL, ((NM_LISTVIEW *)lParam)->iSubItem);\r
                                                ReSortDispList(WIN_LOCAL, &CancelFlg);\r
                                        }\r
@@ -1487,6 +1499,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        {\r
                                                if(((NM_LISTVIEW *)lParam)->iSubItem != 4)\r
                                                {\r
+                                                       // 同時接続対応\r
+                                                       CancelFlg = NO;\r
                                                        SetSortTypeByColumn(WIN_REMOTE, ((NM_LISTVIEW *)lParam)->iSubItem);\r
                                                        ReSortDispList(WIN_REMOTE, &CancelFlg);\r
                                                }\r
@@ -2079,6 +2093,8 @@ void DoubleClickProc(int Win, int Mode, int App)
 //                                                             if((Sts = DoDownLoad(AskCmdCtrlSkt(), &MainTransPkt, NO)) == 429)\r
 //                                                             {\r
 //                                                                     ReConnectCmdSkt();\r
+                                                                       // 同時接続対応\r
+                                                                       CancelFlg = NO;\r
                                                                        Sts = DoDownLoad(AskCmdCtrlSkt(), &MainTransPkt, NO, &CancelFlg);\r
 //                                                             }\r
                                                        }\r
@@ -2851,17 +2867,17 @@ int EnterMasterPasswordAndSet( int Res, HWND hWnd )
 }\r
 \r
 // 暗号化通信対応\r
-BOOL __stdcall SSLTimeoutCallback()\r
+BOOL __stdcall SSLTimeoutCallback(BOOL* pbAborted)\r
 {\r
        Sleep(1);\r
        if(BackgrndMessageProc() == YES)\r
                return TRUE;\r
-       if(CancelFlg == YES)\r
+       if(*pbAborted == YES)\r
                return TRUE;\r
        return FALSE;\r
 }\r
 \r
-BOOL __stdcall SSLConfirmCallback(BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName)\r
+BOOL __stdcall SSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName)\r
 {\r
        BOOL bResult;\r
        int i;\r
@@ -2895,7 +2911,7 @@ BOOL __stdcall SSLConfirmCallback(BOOL bVerified, LPCSTR Certificate, LPCSTR Com
                }\r
        }\r
        if(!bResult)\r
-               CancelFlg = YES;\r
+               *pbAborted = YES;\r
        return bResult;\r
 }\r
 \r
index a61b119..cab68b0 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -62,11 +62,15 @@ extern TRANSPACKET MainTransPkt;
 extern int TimeOut;\r
 extern int SendQuit;\r
 \r
+// 同時接続対応\r
+extern int CancelFlg;\r
+\r
 /*===== ローカルなワーク =====*/\r
 \r
 static int PwdCommandType;\r
 \r
-static int CheckCancelFlg = NO;\r
+// 同時接続対応\r
+//static int CheckCancelFlg = NO;\r
 \r
 \r
 \r
@@ -343,7 +347,9 @@ int DoRENAME(char *Src, char *Dst)
 \r
        Sts = CommandProcCmd(NULL, "RNFR %s", Src);\r
        if(Sts == 350)\r
-               Sts = command(AskCmdCtrlSkt(), NULL, &CheckCancelFlg, "RNTO %s", Dst);\r
+               // 同時接続対応\r
+//             Sts = command(AskCmdCtrlSkt(), NULL, &CheckCancelFlg, "RNTO %s", Dst);\r
+               Sts = command(AskCmdCtrlSkt(), NULL, &CancelFlg, "RNTO %s", Dst);\r
 \r
        if(Sts/100 >= FTP_CONTINUE)\r
                SoundPlay(SND_ERROR);\r
@@ -391,13 +397,14 @@ int DoCHMOD(char *Path, char *Mode)
 \r
 // 同時接続対応\r
 //int DoSIZE(char *Path, LONGLONG *Size)\r
-int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size)\r
+int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size, int *CancelCheckWork)\r
 {\r
        int Sts;\r
        char Tmp[1024];\r
 \r
+       // 同時接続対応\r
 //     Sts = CommandProcTrn(Tmp, "SIZE %s", Path);\r
-       Sts = CommandProcTrn(cSkt, Tmp, "SIZE %s", Path);\r
+       Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "SIZE %s", Path);\r
 \r
        *Size = -1;\r
        if((Sts/100 == FTP_COMPLETE) && (strlen(Tmp) > 4) && IsDigit(Tmp[4]))\r
@@ -423,7 +430,7 @@ int DoSIZE(SOCKET cSkt, char *Path, LONGLONG *Size)
 \r
 // 同時接続対応\r
 //int DoMDTM(char *Path, FILETIME *Time)\r
-int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time)\r
+int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time, int *CancelCheckWork)\r
 {\r
        int Sts;\r
        char Tmp[1024];\r
@@ -432,8 +439,9 @@ int DoMDTM(SOCKET cSkt, char *Path, FILETIME *Time)
     Time->dwLowDateTime = 0;\r
     Time->dwHighDateTime = 0;\r
 \r
+       // 同時接続対応\r
 //     Sts = CommandProcTrn(Tmp, "MDTM %s", Path);\r
-       Sts = CommandProcTrn(cSkt, Tmp, "MDTM %s", Path);\r
+       Sts = CommandProcTrn(cSkt, Tmp, CancelCheckWork, "MDTM %s", Path);\r
        if(Sts/100 == FTP_COMPLETE)\r
        {\r
                sTime.wMilliseconds = 0;\r
@@ -516,7 +524,9 @@ int DoQUIT(SOCKET ctrl_skt)
 \r
        Ret = FTP_COMPLETE;\r
        if(SendQuit == YES)\r
-               Ret = command(ctrl_skt, NULL, &CheckCancelFlg, "QUIT") / 100;\r
+               // 同時接続対応\r
+//             Ret = command(ctrl_skt, NULL, &CheckCancelFlg, "QUIT") / 100;\r
+               Ret = command(ctrl_skt, NULL, &CancelFlg, "QUIT") / 100;\r
 \r
        return(Ret);\r
 }\r
@@ -665,7 +675,9 @@ int CommandProcCmd(char *Reply, char *fmt, ...)
 //     {\r
 //             if(ReConnectCmdSkt() == FFFTP_SUCCESS)\r
 //             {\r
-                       Sts = command(AskCmdCtrlSkt(), Reply, &CheckCancelFlg, "%s", Cmd);\r
+                       // 同時接続対応\r
+//                     Sts = command(AskCmdCtrlSkt(), Reply, &CheckCancelFlg, "%s", Cmd);\r
+                       Sts = command(AskCmdCtrlSkt(), Reply, &CancelFlg, "%s", Cmd);\r
 //             }\r
 //     }\r
        return(Sts);\r
@@ -688,7 +700,7 @@ int CommandProcCmd(char *Reply, char *fmt, ...)
 \r
 // 同時接続対応\r
 //int CommandProcTrn(char *Reply, char *fmt, ...)\r
-int CommandProcTrn(SOCKET cSkt, char *Reply, char *fmt, ...)\r
+int CommandProcTrn(SOCKET cSkt, char *Reply, int* CancelCheckWork, char *fmt, ...)\r
 {\r
        va_list Args;\r
        char Cmd[1024];\r
@@ -705,7 +717,7 @@ int CommandProcTrn(SOCKET cSkt, char *Reply, char *fmt, ...)
 //     {\r
 //             if(ReConnectTrnSkt() == FFFTP_SUCCESS)\r
 //                     Sts = command(AskTrnCtrlSkt(), Reply, &CheckCancelFlg, "%s", Cmd);\r
-                       Sts = command(cSkt, Reply, &CheckCancelFlg, "%s", Cmd);\r
+                       Sts = command(cSkt, Reply, CancelCheckWork, "%s", Cmd);\r
 //     }\r
        return(Sts);\r
 }\r
@@ -1040,14 +1052,8 @@ static int ReadOneLine(SOCKET cSkt, char *Buf, int Max, int *CancelCheckWork)
 \r
                        if((SizeOnce == -2) || (AskTransferNow() == YES))\r
                        // 転送中に全て中止を行うと不正なデータが得られる場合のバグ修正\r
-                       // エラーの種類によっては無限ループとスタックオーバーフローの可能性あり\r
 //                             DisconnectSet();\r
-                       {\r
-                               if(SizeOnce == -1)\r
-                                       ReConnectTrnSkt(&cSkt);\r
-                               else\r
-                                       DisconnectSet();\r
-                       }\r
+                               cSkt = DoClose(cSkt);\r
                }\r
                else\r
                {\r
index 1051425..4a52b06 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -657,7 +657,8 @@ struct hostent *do_gethostbyname(const char *Name, char *Buf, int Len, int *Canc
        DoPrintf("# Start gethostbyname");\r
 #endif\r
        Ret = NULL;\r
-       *CancelCheckWork = NO;\r
+       // 同時接続対応\r
+//     *CancelCheckWork = NO;\r
 \r
        // UTF-8対応\r
 //     hAsync = WSAAsyncGetHostByName(hWndSocket, WM_ASYNC_DBASE, Name, Buf, Len);\r
@@ -771,7 +772,8 @@ int do_connect(SOCKET s, const struct sockaddr *name, int namelen, int *CancelCh
 #if DBG_MSG\r
        DoPrintf("# Start connect (S=%x)", s);\r
 #endif\r
-       *CancelCheckWork = NO;\r
+       // 同時接続対応\r
+//     *CancelCheckWork = NO;\r
 \r
 #if DBG_MSG\r
        DoPrintf("## Async set: FD_CONNECT|FD_CLOSE|FD_ACCEPT|FD_READ|FD_WRITE");\r
@@ -935,7 +937,8 @@ int do_recv(SOCKET s, char *buf, int len, int flags, int *TimeOutErr, int *Cance
        DoPrintf("# Start recv (S=%x)", s);\r
 #endif\r
        *TimeOutErr = NO;\r
-       *CancelCheckWork = NO;\r
+       // 同時接続対応\r
+//     *CancelCheckWork = NO;\r
        Ret = SOCKET_ERROR;\r
        Error = 0;\r
 \r
@@ -981,9 +984,6 @@ int do_recv(SOCKET s, char *buf, int len, int flags, int *TimeOutErr, int *Cance
                        Ret = recvS(s, buf, len, flags);\r
                        if(Ret != SOCKET_ERROR)\r
                                break;\r
-                       // 何故か一部のホストとWindows 2000の組み合わせで通信できないバグに暫定対応\r
-                       if(AskAsyncDone(s, &Error, FD_CLOSE_BIT) == YES && recvS(s, buf, len, MSG_PEEK) <= 0)\r
-                               break;\r
                        Error = WSAGetLastError();\r
                        Sleep(1);\r
                        if(BackgrndMessageProc() == YES)\r
@@ -1035,7 +1035,8 @@ int do_send(SOCKET s, const char *buf, int len, int flags, int *TimeOutErr, int
        DoPrintf("# Start send (S=%x)", s);\r
 #endif\r
        *TimeOutErr = NO;\r
-       *CancelCheckWork = NO;\r
+       // 同時接続対応\r
+//     *CancelCheckWork = NO;\r
        Ret = SOCKET_ERROR;\r
        Error = 0;\r
 \r
@@ -1094,9 +1095,6 @@ int do_send(SOCKET s, const char *buf, int len, int flags, int *TimeOutErr, int
 #endif\r
                                break;\r
                        }\r
-                       // 何故か一部のホストとWindows 2000の組み合わせで通信できないバグに暫定対応\r
-                       if(AskAsyncDone(s, &Error, FD_CLOSE_BIT) == YES)\r
-                               break;\r
                        Error = WSAGetLastError();\r
                        Sleep(1);\r
                        if(BackgrndMessageProc() == YES)\r
index 612218e..79529a4 100644 (file)
@@ -82,13 +82,13 @@ LPSSLCONFIRMCALLBACK g_pOpenSSLConfirmCallback;
 SSL_CTX* g_pOpenSSLCTX;\r
 SSL* g_pOpenSSLHandle[MAX_SSL_SOCKET];\r
 \r
-BOOL __stdcall DefaultSSLTimeoutCallback()\r
+BOOL __stdcall DefaultSSLTimeoutCallback(BOOL* pbAborted)\r
 {\r
        Sleep(100);\r
-       return FALSE;\r
+       return *pbAborted;\r
 }\r
 \r
-BOOL __stdcall DefaultSSLConfirmCallback(BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName)\r
+BOOL __stdcall DefaultSSLConfirmCallback(BOOL* pbAborted, BOOL bVerified, LPCSTR Certificate, LPCSTR CommonName)\r
 {\r
        return bVerified;\r
 }\r
@@ -220,7 +220,7 @@ SSL** FindSSLPointerFromSocket(SOCKET s)
        return NULL;\r
 }\r
 \r
-BOOL ConfirmSSLCertificate(SSL* pSSL)\r
+BOOL ConfirmSSLCertificate(SSL* pSSL, BOOL* pbAborted)\r
 {\r
        BOOL bResult;\r
        BOOL bVerified;\r
@@ -281,7 +281,7 @@ BOOL ConfirmSSLCertificate(SSL* pSSL)
                if(pCN = strchr(pCN, ','))\r
                        pCN++;\r
        }\r
-       bResult = g_pOpenSSLConfirmCallback(bVerified, pData, pCN);\r
+       bResult = g_pOpenSSLConfirmCallback(pbAborted, bVerified, pData, pCN);\r
        if(pData)\r
                free(pData);\r
        if(pSubject)\r
@@ -333,7 +333,7 @@ BOOL IsHostNameMatched(LPCSTR HostName, LPCSTR CommonName)
        return bResult;\r
 }\r
 \r
-BOOL AttachSSL(SOCKET s, SOCKET parent)\r
+BOOL AttachSSL(SOCKET s, SOCKET parent, BOOL* pbAborted)\r
 {\r
        BOOL r;\r
        DWORD Time;\r
@@ -380,7 +380,7 @@ BOOL AttachSSL(SOCKET s, SOCKET parent)
                                                if(Error == SSL_ERROR_WANT_READ || Error == SSL_ERROR_WANT_WRITE)\r
                                                {\r
                                                        LeaveCriticalSection(&g_OpenSSLLock);\r
-                                                       if(g_pOpenSSLTimeoutCallback() || (g_OpenSSLTimeout > 0 && timeGetTime() - Time >= g_OpenSSLTimeout))\r
+                                                       if(g_pOpenSSLTimeoutCallback(pbAborted) || (g_OpenSSLTimeout > 0 && timeGetTime() - Time >= g_OpenSSLTimeout))\r
                                                                r = FALSE;\r
                                                        EnterCriticalSection(&g_OpenSSLLock);\r
                                                }\r
@@ -389,7 +389,7 @@ BOOL AttachSSL(SOCKET s, SOCKET parent)
                                        }\r
                                        if(r)\r
                                        {\r
-                                               if(ConfirmSSLCertificate(*ppSSL))\r
+                                               if(ConfirmSSLCertificate(*ppSSL, pbAborted))\r
                                                {\r
                                                }\r
                                                else\r
@@ -470,8 +470,10 @@ int listenS(SOCKET s, int backlog)
 SOCKET acceptS(SOCKET s, struct sockaddr *addr, int *addrlen)\r
 {\r
        SOCKET r;\r
+       BOOL bAborted;\r
        r = accept(s, addr, addrlen);\r
-       if(!AttachSSL(r, INVALID_SOCKET))\r
+       bAborted = FALSE;\r
+       if(!AttachSSL(r, INVALID_SOCKET, &bAborted))\r
        {\r
                closesocket(r);\r
                return INVALID_SOCKET;\r
@@ -482,8 +484,10 @@ SOCKET acceptS(SOCKET s, struct sockaddr *addr, int *addrlen)
 int connectS(SOCKET s, const struct sockaddr *name, int namelen)\r
 {\r
        int r;\r
+       BOOL bAborted;\r
        r = connect(s, name, namelen);\r
-       if(!AttachSSL(r, INVALID_SOCKET))\r
+       bAborted = FALSE;\r
+       if(!AttachSSL(r, INVALID_SOCKET, &bAborted))\r
                return SOCKET_ERROR;\r
        return r;\r
 }\r
index 574d915..cfef1a2 100644 (file)
@@ -7,8 +7,8 @@
 \r
 #define USE_OPENSSL\r
 \r
-typedef BOOL (__stdcall* LPSSLTIMEOUTCALLBACK)();\r
-typedef BOOL (__stdcall* LPSSLCONFIRMCALLBACK)(BOOL, LPCSTR, LPCSTR);\r
+typedef BOOL (__stdcall* LPSSLTIMEOUTCALLBACK)(BOOL*);\r
+typedef BOOL (__stdcall* LPSSLCONFIRMCALLBACK)(BOOL*, BOOL, LPCSTR, LPCSTR);\r
 \r
 BOOL LoadOpenSSL();\r
 void FreeOpenSSL();\r
@@ -16,7 +16,7 @@ BOOL IsOpenSSLLoaded();
 void SetSSLTimeoutCallback(DWORD Timeout, LPSSLTIMEOUTCALLBACK pCallback);\r
 void SetSSLConfirmCallback(LPSSLCONFIRMCALLBACK pCallback);\r
 BOOL IsHostNameMatched(LPCSTR HostName, LPCSTR CommonName);\r
-BOOL AttachSSL(SOCKET s, SOCKET parent);\r
+BOOL AttachSSL(SOCKET s, SOCKET parent, BOOL* pbAborted);\r
 BOOL DetachSSL(SOCKET s);\r
 BOOL IsSSLAttached(SOCKET s);\r
 SOCKET socketS(int af, int type, int protocol);\r
index df1f451..a9d56f1 100644 (file)
@@ -395,6 +395,8 @@ static LRESULT CALLBACK HistEditBoxWndProc(HWND hWnd, UINT message, WPARAM wPara
                                }\r
                                else\r
                                {\r
+                                       // 同時接続対応\r
+                                       CancelFlg = NO;\r
                                        SendMessage(hWndDirRemoteEdit, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
                                        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
                                        {\r