OSDN Git Service

Fix bugs of hanging on exit.
[ffftp/ffftp.git] / socket.c
index 622dba0..7ae66ab 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -930,7 +930,9 @@ SOCKET do_accept(SOCKET s, struct sockaddr *addr, int *addrlen)
                                DoPrintf("## Async set: FD_CONNECT|FD_CLOSE|FD_ACCEPT|FD_READ|FD_WRITE");\r
 #endif\r
                                RegistAsyncTable(Ret2);\r
-                               if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT | FD_READ | FD_WRITE) == SOCKET_ERROR)\r
+                               // 高速化のためFD_READとFD_WRITEを使用しない\r
+//                             if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT | FD_READ | FD_WRITE) == SOCKET_ERROR)\r
+                               if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT) == SOCKET_ERROR)\r
                                {\r
                                        do_closesocket(Ret2);\r
                                        Ret2 = INVALID_SOCKET;\r
@@ -1190,10 +1192,10 @@ void RemoveReceivedData(SOCKET s)
 {\r
        char buf[1024];\r
        int len;\r
-       int Error;\r
-       while((len = FTPS_recv(s, buf, sizeof(buf), MSG_PEEK)) >= 0)\r
+//     int Error;\r
+       while((len = FTPS_recv(s, buf, sizeof(buf), MSG_PEEK)) > 0)\r
        {\r
-               AskAsyncDone(s, &Error, FD_READ);\r
+//             AskAsyncDone(s, &Error, FD_READ);\r
                FTPS_recv(s, buf, len, 0);\r
        }\r
 }\r