OSDN Git Service

Prepare for release of 1.98f.
[ffftp/ffftp.git] / connect.c
index fcb447d..122f441 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1791,64 +1791,6 @@ static SOCKET DoConnectCrypt(int CryptMode, HOSTDATA* HostData, char *Host, char
                        }\r
                }\r
        }\r
-       else if(CryptMode == CRYPT_SFTP)\r
-       {\r
-               // TODO:\r
-               // テストコード\r
-               // ログイン成功を確認\r
-#define strrcmp(_Str1, _Str2) (strcmp(strstr(_Str1, _Str2) ? strstr(_Str1, _Str2) : "", _Str2))\r
-               size_t r;\r
-               ContSock = SFTP_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);\r
-               SFTP_SetTimeoutCallback(ContSock, SSLTimeoutCallback);\r
-               while(1)\r
-               {\r
-                       r = SFTP_recv(ContSock, Reply, 1024, 0);\r
-                       if(r == SOCKET_ERROR)\r
-                               break;\r
-                       if(r <= 0)\r
-                               continue;\r
-                       Reply[r] = '\0';\r
-                       SetTaskMsg("%s", Reply);\r
-                       if(strrcmp(Reply, "psftp> ") == 0)\r
-                               break;\r
-               }\r
-               r = SFTP_send(ContSock, "open \"", strlen("open \""), 0);\r
-               r = SFTP_send(ContSock, Host, strlen(Host), 0);\r
-               r = SFTP_send(ContSock, "\"\r\n", strlen("\"\r\n"), 0);\r
-               while(1)\r
-               {\r
-                       r = SFTP_recv(ContSock, Reply, 1024, 0);\r
-                       if(r == SOCKET_ERROR)\r
-                               break;\r
-                       if(r <= 0)\r
-                               continue;\r
-                       Reply[r] = '\0';\r
-                       SetTaskMsg("%s", Reply);\r
-                       if(strrcmp(Reply, "Store key in cache? (y/n) ") == 0)\r
-                       {\r
-                               r = SFTP_send(ContSock, "n\r\n", strlen("n\r\n"), 0);\r
-                       }\r
-                       if(strrcmp(Reply, "Update cached key? (y/n, Return cancels connection) ") == 0)\r
-                       {\r
-                               r = SFTP_send(ContSock, "\r\n", strlen("\r\n"), 0);\r
-                       }\r
-                       if(strrcmp(Reply, "login as: ") == 0)\r
-                       {\r
-                               r = SFTP_send(ContSock, User, strlen(User), 0);\r
-                               r = SFTP_send(ContSock, "\r\n", strlen("\r\n"), 0);\r
-                       }\r
-                       if(strrcmp(Reply, "password: ") == 0)\r
-                       {\r
-                               r = SFTP_send(ContSock, Pass, strlen(Pass), 0);\r
-                               r = SFTP_send(ContSock, "\r\n", strlen("\r\n"), 0);\r
-                       }\r
-                       if(strrcmp(Reply, "psftp> ") == 0)\r
-                               break;\r
-                       Sleep(1);\r
-               }\r
-               SFTP_closesocket(ContSock);\r
-               ContSock = INVALID_SOCKET;\r
-       }\r
 \r
        return(ContSock);\r
 }\r
@@ -1860,12 +1802,6 @@ static SOCKET DoConnect(HOSTDATA* HostData, char *Host, char *User, char *Pass,
        SOCKET ContSock;\r
        ContSock = INVALID_SOCKET;\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, CancelCheckWork)) != INVALID_SOCKET)\r
-                       HostData->CryptMode = CRYPT_SFTP;\r
-       }\r
        if(*CancelCheckWork == NO && ContSock == INVALID_SOCKET && HostData->UseFTPIS == YES)\r
        {\r
                SetTaskMsg(MSGJPN316);\r