removed double clean worker data

This commit is contained in:
Ugo Cirmignani
2019-02-12 21:50:10 +01:00
parent 500ab2f81f
commit 3e8f81432c
7 changed files with 6 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1399,7 +1399,7 @@ long long int writeRetrFile(ftpDataType * data, int theSocketId, long long int s
if (writtenSize <= 0)
{
printf("\nError %d while writing retr file.");
printf("\nError %d while writing retr file.", writtenSize);
fclose(retrFP);
retrFP = NULL;
return -1;

View File

@ -568,6 +568,7 @@ void deleteListDataInfoVector(DYNV_VectorGenericDataType *theVector)
void resetWorkerData(ftpDataType *data, int clientId, int isInitialization)
{
printf("\nReset of worker id: %d", clientId);
data->clients[clientId].workerData.connectionPort = 0;
data->clients[clientId].workerData.passiveModeOn = 0;
data->clients[clientId].workerData.socketIsConnected = 0;

View File

@ -192,8 +192,9 @@ int socketPrintf(ftpDataType * ftpData, int clientId, const char *__restrict __f
}
va_end(args);
if (ftpData->clients[clientId].socketIsConnected != 1)
return 0;
if (ftpData->clients[clientId].socketIsConnected != 1 ||
ftpData->clients[clientId].socketDescriptor == 0)
return -1;
if (ftpData->clients[clientId].tlsIsEnabled != 1)
{
@ -638,7 +639,7 @@ void closeSocket(ftpDataType * ftpData, int processingSocket)
theReturnCode = close(ftpData->clients[processingSocket].socketDescriptor);
resetClientData(ftpData, processingSocket, 0);
resetWorkerData(ftpData, processingSocket, 0);
//resetWorkerData(ftpData, processingSocket, 0);
//Update client connecteds
ftpData->connectedClients--;