diff --git a/build/modules/connection.o b/build/modules/connection.o index 9e17366..6a2c9bf 100644 Binary files a/build/modules/connection.o and b/build/modules/connection.o differ diff --git a/build/modules/ftpCommandElaborate.o b/build/modules/ftpCommandElaborate.o index 16f0b1a..5dda6b4 100644 Binary files a/build/modules/ftpCommandElaborate.o and b/build/modules/ftpCommandElaborate.o differ diff --git a/build/modules/ftpData.o b/build/modules/ftpData.o index 0f64fa7..cb1a446 100644 Binary files a/build/modules/ftpData.o and b/build/modules/ftpData.o differ diff --git a/build/uFTP b/build/uFTP index 7fb44da..f4dc51a 100755 Binary files a/build/uFTP and b/build/uFTP differ diff --git a/ftpCommandElaborate.c b/ftpCommandElaborate.c index d7917c8..caa5eaa 100644 --- a/ftpCommandElaborate.c +++ b/ftpCommandElaborate.c @@ -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; diff --git a/ftpData.c b/ftpData.c index 7f579dd..e901ad1 100644 --- a/ftpData.c +++ b/ftpData.c @@ -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; diff --git a/library/connection.c b/library/connection.c index 352c8e9..df3437d 100644 --- a/library/connection.c +++ b/library/connection.c @@ -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--;