- fix the win32 build for vc++
This commit is contained in:
parent
681db699a1
commit
61bc3902bb
|
@ -247,9 +247,9 @@ if(VERBOSE_MODE_ENABLED) printf("ERROR: Connection refused; Session limit reache
|
||||||
*/
|
*/
|
||||||
int ftpShutdown(void)
|
int ftpShutdown(void)
|
||||||
{
|
{
|
||||||
if(VERBOSE_MODE_ENABLED) printf("About to Shutdown Feathery FTP-Server server [%d]\n",server);
|
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
|
if(VERBOSE_MODE_ENABLED) printf("About to Shutdown Feathery FTP-Server server [%d]\n",server);
|
||||||
|
|
||||||
ftpUntrackSocket(server);
|
ftpUntrackSocket(server);
|
||||||
ftpCloseSocket(&server);
|
ftpCloseSocket(&server);
|
||||||
//ftpCloseSocket(serverPassivePort);
|
//ftpCloseSocket(serverPassivePort);
|
||||||
|
|
|
@ -211,8 +211,9 @@ int ftpRemoveDir(const char* path)
|
||||||
|
|
||||||
int ftpCloseSocket(socket_t *s)
|
int ftpCloseSocket(socket_t *s)
|
||||||
{
|
{
|
||||||
|
int ret = 0;
|
||||||
if(VERBOSE_MODE_ENABLED) printf("\nClosing socket: %d\n",*s);
|
if(VERBOSE_MODE_ENABLED) printf("\nClosing socket: %d\n",*s);
|
||||||
int ret = 0;
|
|
||||||
if(*s > 0) {
|
if(*s > 0) {
|
||||||
shutdown((SOCKET)*s,2);
|
shutdown((SOCKET)*s,2);
|
||||||
ret = closesocket((SOCKET)*s);
|
ret = closesocket((SOCKET)*s);
|
||||||
|
@ -340,6 +341,7 @@ socket_t ftpAcceptDataConnection(socket_t listner)
|
||||||
struct sockaddr_in clientinfo;
|
struct sockaddr_in clientinfo;
|
||||||
unsigned len;
|
unsigned len;
|
||||||
SOCKET dataSocket;
|
SOCKET dataSocket;
|
||||||
|
ip_t remoteIP;
|
||||||
|
|
||||||
len = sizeof(clientinfo);
|
len = sizeof(clientinfo);
|
||||||
|
|
||||||
|
@ -352,7 +354,7 @@ socket_t ftpAcceptDataConnection(socket_t listner)
|
||||||
|
|
||||||
ftpCloseSocket(&listner); // Server-Socket wird nicht mehr gebrauch deshalb schließen
|
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(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));
|
if(VERBOSE_MODE_ENABLED) printf("Connection with %s is NOT a valid trusted client, dropping connection.\n", inet_ntoa(clientinfo.sin_addr));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user