OSDN Git Service

Enhance routines for extra commands.
[ffftp/ffftp.git] / socket.c
index 0549f9c..622dba0 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -772,7 +772,7 @@ int do_closesocket(SOCKET s)
        UnRegistAsyncTable(s);\r
        // FTPS対応\r
 //     Ret = closesocket(s);\r
-       Ret = closesocketS(s);\r
+       Ret = FTPS_closesocket(s);\r
        if(Ret == SOCKET_ERROR)\r
        {\r
                Error = 0;\r
@@ -1029,7 +1029,7 @@ int do_recv(SOCKET s, char *buf, int len, int flags, int *TimeOutErr, int *Cance
 \r
                        // FTPS対応\r
 //                     Ret = recv(s, buf, len, flags);\r
-                       Ret = recvS(s, buf, len, flags);\r
+                       Ret = FTPS_recv(s, buf, len, flags);\r
                        if(Ret != SOCKET_ERROR)\r
                                break;\r
                        Error = WSAGetLastError();\r
@@ -1139,7 +1139,7 @@ int do_send(SOCKET s, const char *buf, int len, int flags, int *TimeOutErr, int
 \r
                        // FTPS対応\r
 //                     Ret = send(s, buf, len, flags);\r
-                       Ret = sendS(s, buf, len, flags);\r
+                       Ret = FTPS_send(s, buf, len, flags);\r
                        if(Ret != SOCKET_ERROR)\r
                        {\r
 #if DBG_MSG\r
@@ -1191,10 +1191,10 @@ void RemoveReceivedData(SOCKET s)
        char buf[1024];\r
        int len;\r
        int Error;\r
-       while((len = recvS(s, buf, sizeof(buf), MSG_PEEK)) >= 0)\r
+       while((len = FTPS_recv(s, buf, sizeof(buf), MSG_PEEK)) >= 0)\r
        {\r
                AskAsyncDone(s, &Error, FD_READ);\r
-               recvS(s, buf, len, 0);\r
+               FTPS_recv(s, buf, len, 0);\r
        }\r
 }\r
 \r
@@ -1225,3 +1225,19 @@ int CheckClosedAndReconnect(void)
 \r
 \r
 \r
+// 同時接続対応\r
+int CheckClosedAndReconnectTrnSkt(SOCKET *Skt, int *CancelCheckWork)\r
+{\r
+       int Error;\r
+       int Sts;\r
+\r
+//SetTaskMsg("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");\r
+\r
+       Sts = FFFTP_SUCCESS;\r
+       if(AskAsyncDone(*Skt, &Error, FD_CLOSE) == YES)\r
+       {\r
+               Sts = ReConnectTrnSkt(Skt, CancelCheckWork);\r
+       }\r
+       return(Sts);\r
+}\r
+\r