mirror of
https://github.com/kingk85/uFTP.git
synced 2025-04-12 10:48:40 +03:00
Disable ipv6 with makefile ok
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
#ifndef ENABLE_PRINTF_MODULE
|
||||
|
||||
// Uncomment next line to enable debug printf
|
||||
#define ENABLE_PRINTF
|
||||
#define ENABLE_PRINTF_ERROR
|
||||
// #define ENABLE_PRINTF
|
||||
// #define ENABLE_PRINTF_ERROR
|
||||
|
||||
#define CURRENT_FILE __FILE__
|
||||
#define CURRENT_LINE __LINE__
|
||||
|
@ -2530,6 +2530,24 @@ int parseCommandEprt(ftpDataType *data, int socketId)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef IPV6_ENABLED
|
||||
if(data->clients[socketId].workerData.addressType == 2)
|
||||
{
|
||||
addLog("Error parsing EPRT", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
|
||||
returnCode = socketPrintf(data, socketId, "s", "501 command syntax error no ipv6 supported in this version.\r\n");
|
||||
|
||||
if (returnCode <= 0)
|
||||
{
|
||||
addLog("socketPrintfError ", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
|
||||
return FTP_COMMAND_PROCESSED_WRITE_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FTP_COMMAND_PROCESSED;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void *pReturn;
|
||||
if (data->clients[socketId].workerData.threadIsAlive == 1)
|
||||
{
|
||||
|
@ -240,8 +240,10 @@ void *connectionWorkerHandle(void * socketId)
|
||||
my_printf("\n ----------------- CREATING ACTIVE SOCKET --------------!");
|
||||
if (ftpData.clients[theSocketId].workerData.addressType == 1)
|
||||
ftpData.clients[theSocketId].workerData.socketConnection = createActiveSocket(ftpData.clients[theSocketId].workerData.connectionPort, ftpData.clients[theSocketId].workerData.activeIpAddress);
|
||||
#ifdef IPV6_ENABLED
|
||||
else if (ftpData.clients[theSocketId].workerData.addressType == 2)
|
||||
ftpData.clients[theSocketId].workerData.socketConnection = createActiveSocketV6(ftpData.clients[theSocketId].workerData.connectionPort, ftpData.clients[theSocketId].workerData.activeIpAddress);
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_ENABLED
|
||||
if (ftpData.clients[theSocketId].dataChannelIsTls == 1)
|
||||
|
@ -632,7 +632,7 @@ int createPassiveSocket(int port)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef IPV6_ENABLED
|
||||
int createActiveSocketV6(int port, char *ipAddress)
|
||||
{
|
||||
int sockfd;
|
||||
@ -690,6 +690,7 @@ int createActiveSocketV6(int port, char *ipAddress)
|
||||
|
||||
return sockfd;
|
||||
}
|
||||
#endif
|
||||
|
||||
int createActiveSocket(int port, char *ipAddress)
|
||||
{
|
||||
@ -754,7 +755,6 @@ int createActiveSocket(int port, char *ipAddress)
|
||||
return sockfd;
|
||||
}
|
||||
|
||||
|
||||
void fdInit(ftpDataType * ftpData)
|
||||
{
|
||||
FD_ZERO(&ftpData->connectionData.rset);
|
||||
|
@ -36,7 +36,11 @@ int getMaximumSocketFd(int mainSocket, ftpDataType * data);
|
||||
int createSocket(ftpDataType * ftpData);
|
||||
int createPassiveSocket(int port);
|
||||
int createActiveSocket(int port, char *ipAddress);
|
||||
|
||||
#ifdef IPV6_ENABLED
|
||||
int createActiveSocketV6(int port, char *ipAddress);
|
||||
#endif
|
||||
|
||||
void fdInit(ftpDataType * ftpData);
|
||||
void fdAdd(ftpDataType * ftpData, int index);
|
||||
void fdRemove(ftpDataType * ftpData, int index);
|
||||
|
Reference in New Issue
Block a user