From 7b05993702399a9856e5835b1460668b821d7d83 Mon Sep 17 00:00:00 2001 From: Ugo Cirmignani Date: Thu, 13 Dec 2018 23:09:57 +0100 Subject: [PATCH] resolving conflicts --- ftpCommandElaborate.c | 21 ++++----------------- ftpData.c | 22 ---------------------- ftpServer.c | 2 +- library/connection.c | 10 ---------- 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/ftpCommandElaborate.c b/ftpCommandElaborate.c index 1677380..900fccf 100644 --- a/ftpCommandElaborate.c +++ b/ftpCommandElaborate.c @@ -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) diff --git a/ftpData.c b/ftpData.c index 8a2d1cf..f4df1eb 100644 --- a/ftpData.c +++ b/ftpData.c @@ -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) diff --git a/ftpServer.c b/ftpServer.c index d6ec03b..b065008 100644 --- a/ftpServer.c +++ b/ftpServer.c @@ -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; diff --git a/library/connection.c b/library/connection.c index 691af47..3c4103d 100644 --- a/library/connection.c +++ b/library/connection.c @@ -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);