From 4eb2a165e800e8afb40f844f765e39210d8d6a58 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 14 Mar 2001 18:24:07 +0000 Subject: [PATCH] removed a bunch of warnings for IPv6-compiles --- lib/ftp.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/ftp.c b/lib/ftp.c index b20e845..228ae0e 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -77,6 +77,8 @@ #include "krb4.h" #endif +#include "strequal.h" + #define _MPRINTF_REPLACE /* use our functions only */ #include @@ -549,13 +551,14 @@ CURLcode _ftp(struct connectdata *conn) char *buf = data->buffer; /* this is our buffer */ /* for the ftp PORT mode */ int portsock=-1; - struct sockaddr_in serv_addr; - char hostent_buf[8192]; #if defined (HAVE_INET_NTOA_R) char ntoa_buf[64]; #endif #ifdef ENABLE_IPV6 struct addrinfo *ai; +#else + struct sockaddr_in serv_addr; + char hostent_buf[8192]; #endif struct curl_slist *qitem; /* QUOTE item */ @@ -715,20 +718,20 @@ CURLcode _ftp(struct connectdata *conn) #ifdef ENABLE_IPV6 struct addrinfo hints, *res, *ai; struct sockaddr_storage ss; - int sslen; + socklen_t sslen; char hbuf[NI_MAXHOST]; - char *localaddr; + struct sockaddr *sa=(struct sockaddr *)&ss; #ifdef NI_WITHSCOPEID const int niflags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; #else const int niflags = NI_NUMERICHOST | NI_NUMERICSERV; #endif - unsigned char *ap; - unsigned char *pp; + char *ap; + char *pp; int alen, plen; char portmsgbuf[4096], tmp[4096]; - char *p; + char *mode[] = { "EPRT", "LPRT", "PORT", NULL }; char **modep; @@ -761,13 +764,13 @@ CURLcode _ftp(struct connectdata *conn) continue; if (bind(portsock, ai->ai_addr, ai->ai_addrlen) < 0) { - close(portsock); + sclose(portsock); portsock = -1; continue; } if (listen(portsock, 1) < 0) { - close(portsock); + sclose(portsock); portsock = -1; continue; } @@ -878,7 +881,7 @@ again:; } if (!*modep) { - close(portsock); + sclose(portsock); freeaddrinfo(res); return CURLE_FTP_PORT_FAILED; } @@ -1027,9 +1030,10 @@ again:; struct addrinfo *res; #else struct hostent *he; -#endif - char *str=buf,*ip_addr; char *hostdataptr=NULL; + char *ip_addr; +#endif + char *str=buf; /* * New 227-parser June 3rd 1999. -- 2.7.4