From 61bc3902bb315973b6f1b42fcf9e00c27c830da5 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 15 Jan 2011 23:36:58 +0000 Subject: [PATCH] - fix the win32 build for vc++ --- source/shared_lib/sources/feathery_ftp/ftpRuntime.c | 4 ++-- source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/shared_lib/sources/feathery_ftp/ftpRuntime.c b/source/shared_lib/sources/feathery_ftp/ftpRuntime.c index 9c329e2a..8d5e7e0a 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpRuntime.c +++ b/source/shared_lib/sources/feathery_ftp/ftpRuntime.c @@ -247,9 +247,9 @@ if(VERBOSE_MODE_ENABLED) printf("ERROR: Connection refused; Session limit reache */ int ftpShutdown(void) { - if(VERBOSE_MODE_ENABLED) printf("About to Shutdown Feathery FTP-Server server [%d]\n",server); - int n; + if(VERBOSE_MODE_ENABLED) printf("About to Shutdown Feathery FTP-Server server [%d]\n",server); + ftpUntrackSocket(server); ftpCloseSocket(&server); //ftpCloseSocket(serverPassivePort); diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 2180fb89..a7548811 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -211,8 +211,9 @@ int ftpRemoveDir(const char* path) int ftpCloseSocket(socket_t *s) { + int ret = 0; if(VERBOSE_MODE_ENABLED) printf("\nClosing socket: %d\n",*s); - int ret = 0; + if(*s > 0) { shutdown((SOCKET)*s,2); ret = closesocket((SOCKET)*s); @@ -340,6 +341,7 @@ socket_t ftpAcceptDataConnection(socket_t listner) struct sockaddr_in clientinfo; unsigned len; SOCKET dataSocket; + ip_t remoteIP; len = sizeof(clientinfo); @@ -352,7 +354,7 @@ socket_t ftpAcceptDataConnection(socket_t listner) ftpCloseSocket(&listner); // Server-Socket wird nicht mehr gebrauch deshalb schließen - ip_t remoteIP = ntohl(clientinfo.sin_addr.s_addr); + remoteIP = ntohl(clientinfo.sin_addr.s_addr); if(ftpIsValidClient && ftpIsValidClient(remoteIP) == 0) { if(VERBOSE_MODE_ENABLED) printf("Connection with %s is NOT a valid trusted client, dropping connection.\n", inet_ntoa(clientinfo.sin_addr));