mirror of
https://github.com/kingk85/uFTP.git
synced 2025-04-12 10:48:40 +03:00
Sleep between close and data reset
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/uFTP
BIN
build/uFTP
Binary file not shown.
@ -632,9 +632,11 @@ void resetClientData(ftpDataType *data, int clientId, int isInitialization)
|
||||
{
|
||||
if (isInitialization != 1)
|
||||
{
|
||||
if (data->clients[clientId].workerData.threadIsAlive == 1)
|
||||
if (data->clients[clientId].workerData.threadIsAlive == 1){
|
||||
pthread_cancel(data->clients[clientId].workerData.workerThread);
|
||||
|
||||
usleep(10000);
|
||||
printf("Thread had ben cancelled!");
|
||||
}
|
||||
pthread_mutex_destroy(&data->clients[clientId].conditionMutex);
|
||||
pthread_cond_destroy(&data->clients[clientId].conditionVariable);
|
||||
|
||||
|
@ -597,7 +597,8 @@ void closeClient(ftpDataType * ftpData, int processingSocket)
|
||||
if (ftpData->clients[processingSocket].workerData.threadIsAlive == 1)
|
||||
{
|
||||
pthread_cancel(ftpData->clients[processingSocket].workerData.workerThread);
|
||||
//printf("\nQuit command received the Pasv Thread has been cancelled.");
|
||||
printf("\nQuit command received the Pasv Thread has been cancelled!!!");
|
||||
usleep(10000);
|
||||
}
|
||||
|
||||
FD_CLR(ftpData->clients[processingSocket].socketDescriptor, &ftpData->connectionData.rsetAll);
|
||||
|
Reference in New Issue
Block a user