removed a bunch of warnings for IPv6-compiles
This commit is contained in:
parent
b7fc1e45b5
commit
4eb2a165e8
28
lib/ftp.c
28
lib/ftp.c
@ -77,6 +77,8 @@
|
|||||||
#include "krb4.h"
|
#include "krb4.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "strequal.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
@ -549,13 +551,14 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
char *buf = data->buffer; /* this is our buffer */
|
char *buf = data->buffer; /* this is our buffer */
|
||||||
/* for the ftp PORT mode */
|
/* for the ftp PORT mode */
|
||||||
int portsock=-1;
|
int portsock=-1;
|
||||||
struct sockaddr_in serv_addr;
|
|
||||||
char hostent_buf[8192];
|
|
||||||
#if defined (HAVE_INET_NTOA_R)
|
#if defined (HAVE_INET_NTOA_R)
|
||||||
char ntoa_buf[64];
|
char ntoa_buf[64];
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
|
#else
|
||||||
|
struct sockaddr_in serv_addr;
|
||||||
|
char hostent_buf[8192];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct curl_slist *qitem; /* QUOTE item */
|
struct curl_slist *qitem; /* QUOTE item */
|
||||||
@ -715,20 +718,20 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct addrinfo hints, *res, *ai;
|
struct addrinfo hints, *res, *ai;
|
||||||
struct sockaddr_storage ss;
|
struct sockaddr_storage ss;
|
||||||
int sslen;
|
socklen_t sslen;
|
||||||
char hbuf[NI_MAXHOST];
|
char hbuf[NI_MAXHOST];
|
||||||
char *localaddr;
|
|
||||||
struct sockaddr *sa=(struct sockaddr *)&ss;
|
struct sockaddr *sa=(struct sockaddr *)&ss;
|
||||||
#ifdef NI_WITHSCOPEID
|
#ifdef NI_WITHSCOPEID
|
||||||
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
||||||
#else
|
#else
|
||||||
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
|
const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
|
||||||
#endif
|
#endif
|
||||||
unsigned char *ap;
|
char *ap;
|
||||||
unsigned char *pp;
|
char *pp;
|
||||||
int alen, plen;
|
int alen, plen;
|
||||||
char portmsgbuf[4096], tmp[4096];
|
char portmsgbuf[4096], tmp[4096];
|
||||||
char *p;
|
|
||||||
char *mode[] = { "EPRT", "LPRT", "PORT", NULL };
|
char *mode[] = { "EPRT", "LPRT", "PORT", NULL };
|
||||||
char **modep;
|
char **modep;
|
||||||
|
|
||||||
@ -761,13 +764,13 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (bind(portsock, ai->ai_addr, ai->ai_addrlen) < 0) {
|
if (bind(portsock, ai->ai_addr, ai->ai_addrlen) < 0) {
|
||||||
close(portsock);
|
sclose(portsock);
|
||||||
portsock = -1;
|
portsock = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listen(portsock, 1) < 0) {
|
if (listen(portsock, 1) < 0) {
|
||||||
close(portsock);
|
sclose(portsock);
|
||||||
portsock = -1;
|
portsock = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -878,7 +881,7 @@ again:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!*modep) {
|
if (!*modep) {
|
||||||
close(portsock);
|
sclose(portsock);
|
||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
return CURLE_FTP_PORT_FAILED;
|
return CURLE_FTP_PORT_FAILED;
|
||||||
}
|
}
|
||||||
@ -1027,9 +1030,10 @@ again:;
|
|||||||
struct addrinfo *res;
|
struct addrinfo *res;
|
||||||
#else
|
#else
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
#endif
|
|
||||||
char *str=buf,*ip_addr;
|
|
||||||
char *hostdataptr=NULL;
|
char *hostdataptr=NULL;
|
||||||
|
char *ip_addr;
|
||||||
|
#endif
|
||||||
|
char *str=buf;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* New 227-parser June 3rd 1999.
|
* New 227-parser June 3rd 1999.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user