- attempt for ftp bigfixes
This commit is contained in:
parent
61bc3902bb
commit
6e7bcd2ece
|
@ -146,18 +146,6 @@ int ftpExecute(void)
|
||||||
int sessionId=0;
|
int sessionId=0;
|
||||||
int activeJobs=0;
|
int activeJobs=0;
|
||||||
|
|
||||||
activeJobs = ftpGetActiveTransCnt(); // are there any active transmitions?
|
|
||||||
for(n = 0; (activeJobs > 0) && (n < MAX_CONNECTIONS); n++)
|
|
||||||
{
|
|
||||||
pSession = ftpGetSession(n);
|
|
||||||
if(pSession->activeTrans.op) // has this session an active transmition?
|
|
||||||
{
|
|
||||||
processedWork = 1;
|
|
||||||
ftpExecTransmission(n); // do the job
|
|
||||||
activeJobs--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ftpGetActiveTransCnt()) // don't block if there's still something to do
|
if(ftpGetActiveTransCnt()) // don't block if there's still something to do
|
||||||
{
|
{
|
||||||
socksRdy = ftpSelect(TRUE);
|
socksRdy = ftpSelect(TRUE);
|
||||||
|
@ -233,6 +221,18 @@ if(VERBOSE_MODE_ENABLED) printf("ERROR: Connection refused; Session limit reache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activeJobs = ftpGetActiveTransCnt(); // are there any active transmitions?
|
||||||
|
for(n = 0; (activeJobs > 0) && (n < MAX_CONNECTIONS); n++)
|
||||||
|
{
|
||||||
|
pSession = ftpGetSession(n);
|
||||||
|
if(pSession->activeTrans.op) // has this session an active transmition?
|
||||||
|
{
|
||||||
|
processedWork = 1;
|
||||||
|
ftpExecTransmission(n); // do the job
|
||||||
|
activeJobs--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return processedWork;
|
return processedWork;
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,7 +289,7 @@ socket_t ftpEstablishDataConnection(int passive, ip_t *ip, port_t *port, int ses
|
||||||
|
|
||||||
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d about to listen on port: %d using listener socket: %d\n",sessionId,passivePort,*port,dataSocket);
|
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d about to listen on port: %d using listener socket: %d\n",sessionId,passivePort,*port,dataSocket);
|
||||||
|
|
||||||
if(listen(dataSocket, 1))
|
if(listen(dataSocket, 100))
|
||||||
{
|
{
|
||||||
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d FAILED #2: %d\n",sessionId,passivePort,dataSocket);
|
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d FAILED #2: %d\n",sessionId,passivePort,dataSocket);
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ socket_t ftpCreateServerSocket(int portNumber)
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(listen(theServer, 16))
|
if(listen(theServer, 100))
|
||||||
{
|
{
|
||||||
ftpCloseSocket(&theServer);
|
ftpCloseSocket(&theServer);
|
||||||
return -3;
|
return -3;
|
||||||
|
|
|
@ -321,7 +321,7 @@ socket_t ftpEstablishDataConnection(int passive, ip_t *ip, port_t *port, int ses
|
||||||
|
|
||||||
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d about to listen on port: %d using listener socket: %d\n",sessionId,passivePort,*port,dataSocket);
|
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d about to listen on port: %d using listener socket: %d\n",sessionId,passivePort,*port,dataSocket);
|
||||||
|
|
||||||
if(listen(dataSocket, 1))
|
if(listen(dataSocket, 100))
|
||||||
{
|
{
|
||||||
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d FAILED #2: %d\n",sessionId,passivePort,dataSocket);
|
if(VERBOSE_MODE_ENABLED) printf("\nPASSIVE CONNECTION for sessionId = %d using port #: %d FAILED #2: %d\n",sessionId,passivePort,dataSocket);
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ socket_t ftpCreateServerSocket(int portNumber)
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(listen(theServer, 16))
|
if(listen(theServer, 100))
|
||||||
{
|
{
|
||||||
ftpCloseSocket(&theServer);
|
ftpCloseSocket(&theServer);
|
||||||
return -3;
|
return -3;
|
||||||
|
|
|
@ -339,8 +339,6 @@ void removeFolder(const string path) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
||||||
|
|
||||||
string deletePath = path + "*";
|
string deletePath = path + "*";
|
||||||
//vector<string> results;
|
|
||||||
//findAll(deletePath, results, false, false);
|
|
||||||
vector<string> results = getFolderTreeContentsListRecursively(deletePath, "", true);
|
vector<string> results = getFolderTreeContentsListRecursively(deletePath, "", true);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s] results.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),results.size());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s] results.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),results.size());
|
||||||
|
|
||||||
|
@ -367,6 +365,9 @@ void removeFolder(const string path) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] item [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,item.c_str(),result);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] item [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,item.c_str(),result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int result = rmdir(path.c_str());
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartsWith(const std::string &str, const std::string &key) {
|
bool StartsWith(const std::string &str, const std::string &key) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user