resolving conflicts

This commit is contained in:
Ugo Cirmignani
2018-12-13 23:09:57 +01:00
parent 353bc377fa
commit 7b05993702
4 changed files with 5 additions and 50 deletions

View File

@ -499,22 +499,14 @@ int parseCommandPort(ftpDataType * data, int socketId)
returnCode = snprintf(data->clients[socketId].workerData.activeIpAddress, CLIENT_BUFFER_STRING_SIZE, "%d.%d.%d.%d", ipAddressBytes[0],ipAddressBytes[1],ipAddressBytes[2],ipAddressBytes[3]);
void *pReturn;
//if (data->clients[socketId].workerData.threadIsAlive == 1)
//{
if (data->clients[socketId].workerData.threadIsAlive == 1)
{
returnCode = pthread_cancel(data->clients[socketId].workerData.workerThread);
<<<<<<< HEAD
//}
returnCode = pthread_join(data->clients[socketId].workerData.workerThread, &pReturn);
=======
}
if (data->clients[socketId].workerData.threadHasBeenCreated == 1)
{
returnCode = pthread_join(data->clients[socketId].workerData.workerThread, &pReturn);
<<<<<<< HEAD
}
=======
>>>>>>> cd589876b02918418d1253f35b68349522f82294
>>>>>>> a36f2a8ba89a857bd0a379b4f2f1931be56579d0
data->clients[socketId].workerData.passiveModeOn = 0;
data->clients[socketId].workerData.activeModeOn = 1;
returnCode = pthread_create(&data->clients[socketId].workerData.workerThread, NULL, connectionWorkerHandle, (void *) &data->clients[socketId].clientProgressiveNumber);
@ -541,15 +533,10 @@ int parseCommandAbor(ftpDataType * data, int socketId)
if (data->clients[socketId].workerData.threadIsAlive == 1)
{
void *pReturn;
//if (data->clients[socketId].workerData.threadIsAlive == 1)
//{
if (data->clients[socketId].workerData.threadIsAlive == 1)
{
pthread_cancel(data->clients[socketId].workerData.workerThread);
<<<<<<< HEAD
//}
pthread_join(data->clients[socketId].workerData.workerThread, &pReturn);
=======
}
>>>>>>> cd589876b02918418d1253f35b68349522f82294
returnCode = socketPrintf(data, socketId, "s", "426 ABORT\r\n");
if (returnCode <= 0)

View File

@ -639,38 +639,16 @@ void resetClientData(ftpDataType *data, int clientId, int isInitialization)
if (isInitialization != 1)
{
<<<<<<< HEAD
if (data->clients[clientId].workerData.threadIsAlive == 1)
{
void *pReturn;
pthread_cancel(data->clients[clientId].workerData.workerThread);
pthread_join(data->clients[clientId].workerData.workerThread, &pReturn);
}
else
{
void *pReturn = NULL;
pthread_cancel(data->clients[clientId].workerData.workerThread);
pthread_join(data->clients[clientId].workerData.workerThread, &pReturn);
}
=======
void *pReturn;
if (data->clients[clientId].workerData.threadIsAlive == 1)
pthread_cancel(data->clients[clientId].workerData.workerThread);
>>>>>>> cd589876b02918418d1253f35b68349522f82294
pthread_mutex_destroy(&data->clients[clientId].writeMutex);
<<<<<<< HEAD
#ifdef OPENSSL_ENABLED
SSL_free(data->clients[clientId].ssl);
SSL_free(data->clients[clientId].workerData.ssl);
#endif
=======
#ifdef OPENSSL_ENABLED
SSL_free(data->clients[clientId].ssl);
//SSL_free(data->clients[clientId].workerData.ssl);
#endif
>>>>>>> cd589876b02918418d1253f35b68349522f82294
}
if (pthread_mutex_init(&data->clients[clientId].writeMutex, NULL) != 0)

View File

@ -571,7 +571,7 @@ void runFtpServer(void)
//Debug print errors
if (ftpData.clients[processingSock].bufferIndex < 0)
{
//ftpData.clients[processingSock].closeTheClient = 1;
ftpData.clients[processingSock].closeTheClient = 1;
printf("\n1 Errno = %d", errno);
perror("1 Error: ");
continue;

View File

@ -460,15 +460,6 @@ void closeClient(ftpDataType * ftpData, int processingSocket)
{
printf("\nQUIT FLAG SET!\n");
<<<<<<< HEAD
// if (ftpData->clients[processingSocket].workerData.threadIsAlive == 1)
// {
void *pReturn;
pthread_cancel(ftpData->clients[processingSocket].workerData.workerThread);
pthread_join(ftpData->clients[processingSocket].workerData.workerThread, &pReturn);
printf("\nQuit command received the Pasv Thread has been cancelled.");
// }
=======
if (ftpData->clients[processingSocket].workerData.threadIsAlive == 1)
{
void *pReturn;
@ -476,7 +467,6 @@ void closeClient(ftpDataType * ftpData, int processingSocket)
//pthread_join(ftpData->clients[processingSocket].workerData.workerThread, &pReturn);
printf("\nQuit command received the Pasv Thread has been cancelled.");
}
>>>>>>> cd589876b02918418d1253f35b68349522f82294
FD_CLR(ftpData->clients[processingSocket].socketDescriptor, &ftpData->connectionData.rsetAll);
FD_CLR(ftpData->clients[processingSocket].socketDescriptor, &ftpData->connectionData.wsetAll);