Loweynet
Revisão | e9a6d523e00faf31fcec49598aaea96681d5b53c (tree) |
---|---|
Hora | 2012-02-16 23:16:12 |
Autor | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Fix bugs of hanging on exit.
@@ -930,7 +930,9 @@ SOCKET do_accept(SOCKET s, struct sockaddr *addr, int *addrlen) | ||
930 | 930 | DoPrintf("## Async set: FD_CONNECT|FD_CLOSE|FD_ACCEPT|FD_READ|FD_WRITE"); |
931 | 931 | #endif |
932 | 932 | RegistAsyncTable(Ret2); |
933 | - if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT | FD_READ | FD_WRITE) == SOCKET_ERROR) | |
933 | + // 高速化のためFD_READとFD_WRITEを使用しない | |
934 | +// if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT | FD_READ | FD_WRITE) == SOCKET_ERROR) | |
935 | + if(WSAAsyncSelect(Ret2, hWndSocket, WM_ASYNC_SOCKET, FD_CONNECT | FD_CLOSE | FD_ACCEPT) == SOCKET_ERROR) | |
934 | 936 | { |
935 | 937 | do_closesocket(Ret2); |
936 | 938 | Ret2 = INVALID_SOCKET; |
@@ -1190,10 +1192,10 @@ void RemoveReceivedData(SOCKET s) | ||
1190 | 1192 | { |
1191 | 1193 | char buf[1024]; |
1192 | 1194 | int len; |
1193 | - int Error; | |
1194 | - while((len = FTPS_recv(s, buf, sizeof(buf), MSG_PEEK)) >= 0) | |
1195 | +// int Error; | |
1196 | + while((len = FTPS_recv(s, buf, sizeof(buf), MSG_PEEK)) > 0) | |
1195 | 1197 | { |
1196 | - AskAsyncDone(s, &Error, FD_READ); | |
1198 | +// AskAsyncDone(s, &Error, FD_READ); | |
1197 | 1199 | FTPS_recv(s, buf, len, 0); |
1198 | 1200 | } |
1199 | 1201 | } |