#include "krb4.h"
#endif
+#include "strequal.h"
+
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
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 */
#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;
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;
}
}
if (!*modep) {
- close(portsock);
+ sclose(portsock);
freeaddrinfo(res);
return CURLE_FTP_PORT_FAILED;
}
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.