- bugfix for compiling in VC++

This commit is contained in:
Mark Vejvoda 2010-12-30 16:05:47 +00:00
parent 3f0ee7a6cb
commit 1480d7c68d
2 changed files with 4 additions and 2 deletions

View File

@ -667,6 +667,7 @@ LOCAL int ftpCmdPasv(int sessionId, const char* args, int len)
uint32_t ip; uint32_t ip;
char str[50]; char str[50];
socket_t s; socket_t s;
uint32_t remoteFTPServerIp;
if(ftpGetSession(sessionId)->passiveDataSocket >= 0) if(ftpGetSession(sessionId)->passiveDataSocket >= 0)
{ {
@ -688,7 +689,7 @@ LOCAL int ftpCmdPasv(int sessionId, const char* args, int len)
ftpAddUPNPPortForward(port, port); ftpAddUPNPPortForward(port, port);
} }
ip_t remoteFTPServerIp = ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp); remoteFTPServerIp = ftpFindExternalFTPServerIp(ftpGetSession(sessionId)->remoteIp);
sprintf(str, "%s (%d,%d,%d,%d,%d,%d)", sprintf(str, "%s (%d,%d,%d,%d,%d,%d)",
ftpMsg029, ftpMsg029,

View File

@ -307,11 +307,12 @@ string Ip::getString() const{
#if defined(__FreeBSD__) || defined(BSD) || defined(__APPLE__) || defined(__linux__) #if defined(__FreeBSD__) || defined(BSD) || defined(__APPLE__) || defined(__linux__)
# define USE_GETIFADDRS 1 # define USE_GETIFADDRS 1
# include <ifaddrs.h> # include <ifaddrs.h>
#endif
static uint32 SockAddrToUint32(struct sockaddr * a) static uint32 SockAddrToUint32(struct sockaddr * a)
{ {
return ((a)&&(a->sa_family == AF_INET)) ? ntohl(((struct sockaddr_in *)a)->sin_addr.s_addr) : 0; return ((a)&&(a->sa_family == AF_INET)) ? ntohl(((struct sockaddr_in *)a)->sin_addr.s_addr) : 0;
} }
#endif
// convert a numeric IP address into its string representation // convert a numeric IP address into its string representation
static void Inet_NtoA(uint32 addr, char * ipbuf) static void Inet_NtoA(uint32 addr, char * ipbuf)