- numerous thread bugfixes related to menu stability and ftp server socket usage

This commit is contained in:
Mark Vejvoda
2011-01-02 09:33:37 +00:00
parent 2b1732e27e
commit 5f4d3e9088
16 changed files with 235 additions and 100 deletions

View File

@@ -674,14 +674,13 @@ LOCAL int ftpCmdPasv(int sessionId, const char* args, int len)
if(VERBOSE_MODE_ENABLED) printf("In ftpCmdPasv sessionId = %d, client IP = %u, remote IP = %u, port = %d, ftpAddUPNPPortForward = %p, ftpRemoveUPNPPortForward = %p\n",
sessionId, ftpGetSession(sessionId)->remoteIp, ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp), port,ftpAddUPNPPortForward,ftpRemoveUPNPPortForward);
if(ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp) != 0)
if(ftpAddUPNPPortForward != NULL && ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp) != 0)
{
ftpGetSession(sessionId)->remoteFTPServerPassivePort = port;
if(ftpAddUPNPPortForward) {
if(VERBOSE_MODE_ENABLED) printf("In ftpCmdPasv sessionId = %d, adding UPNP port forward\n", sessionId);
ftpAddUPNPPortForward(port, port);
}
ftpAddUPNPPortForward(port, port);
remoteFTPServerIp = ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp);

View File

@@ -205,8 +205,8 @@ int ftpShutdown(void)
if(ftpGetSession(n)->open)
{
ftpUntrackSocket(ftpGetSession(n)->ctrlSocket);
ftpCloseSession(n);
}
}
ftpCloseSession(n);
}
ftpArchCleanup();

View File

@@ -129,11 +129,15 @@ if(VERBOSE_MODE_ENABLED) printf("In ftpCloseSession sessionId = %d, remote IP =
if(VERBOSE_MODE_ENABLED) printf("In ftpCmdPasv sessionId = %d, removing UPNP port forward [%d]\n", id,sessions[id].remoteFTPServerPassivePort);
ftpRemoveUPNPPortForward(sessions[id].remoteFTPServerPassivePort, sessions[id].remoteFTPServerPassivePort);
sessions[id].remoteFTPServerPassivePort = 0;
}
}
ftpCloseSocket(sessions[id].ctrlSocket);
ftpCloseTransmission(id);
if(sessions[id].open) {
ftpCloseSocket(sessions[id].ctrlSocket);
ftpCloseTransmission(id);
}
sessions[id].remoteIp = 0;
sessions[id].ctrlSocket = 0;
sessions[id].open = FALSE;
if(VERBOSE_MODE_ENABLED) printf("Session %d closed\n", id);