mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 10:19:55 +02:00
- numerous thread bugfixes related to menu stability and ftp server socket usage
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -205,8 +205,8 @@ int ftpShutdown(void)
|
||||
if(ftpGetSession(n)->open)
|
||||
{
|
||||
ftpUntrackSocket(ftpGetSession(n)->ctrlSocket);
|
||||
ftpCloseSession(n);
|
||||
}
|
||||
}
|
||||
ftpCloseSession(n);
|
||||
}
|
||||
|
||||
ftpArchCleanup();
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user