diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-11-28 23:20:14 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-11-28 23:20:14 +0000 |
commit | 332eb7651a651ef03dc15197a8d11baa54873f8d (patch) | |
tree | faf3c17b2eb30b5cc2df46e4f8d9b88a625a2002 /lib/ftp.c | |
parent | cfdcf5c93325b55cd223484b65b73b20a296a6e9 (diff) |
CURLOPT_FTP_USE_EPSV can now be set to FALSE to prevent libcurl from
attempting to use EPSV before the standard PASV.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -812,7 +812,7 @@ ftp_pasv_verbose(struct connectdata *conn, #ifdef HAVE_INET_NTOA_R char ntoa_buf[64]; #endif - char hostent_buf[8192]; + char hostent_buf[9000]; #if defined(HAVE_INET_ADDR) in_addr_t address; @@ -824,12 +824,19 @@ ftp_pasv_verbose(struct connectdata *conn, # ifdef HAVE_GETHOSTBYADDR_R # ifdef HAVE_GETHOSTBYADDR_R_5 - /* AIX, Digital Unix style: + /* AIX, Digital Unix (OSF1, Tru64) style: extern int gethostbyaddr_r(char *addr, size_t len, int type, struct hostent *htent, struct hostent_data *ht_data); */ /* Fred Noz helped me try this out, now it at least compiles! */ + /* Bjorn Reese (November 28 2001): + The Tru64 man page on gethostbyaddr_r() says that + the hostent struct must be filled with zeroes before the call to + gethostbyaddr_r(). */ + + memset(hostent_buf, 0, sizeof(struct hostent)); + if(gethostbyaddr_r((char *) &address, sizeof(address), AF_INET, (struct hostent *)hostent_buf, @@ -1297,7 +1304,8 @@ CURLcode ftp_use_pasv(struct connectdata *conn) char newhost[48]; char *newhostp=NULL; - for (modeoff = 0; mode[modeoff]; modeoff++) { + for (modeoff = (data->set.ftp_use_epsv?0:1); + mode[modeoff]; modeoff++) { result = Curl_ftpsendf(conn, mode[modeoff]); if(result) return result; |