diff options
author | Jani Taskinen <jani@php.net> | 2007-12-29 18:46:10 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2007-12-29 18:46:10 +0000 |
commit | 060d95bb9e969f046010aed025662e6a2c7874f8 (patch) | |
tree | e0bf2483b176215f66c1d50da910f00b31c3cec1 /ext | |
parent | cdaaa15ddf7f64029275ce70898f74f54b89746a (diff) | |
download | php-git-060d95bb9e969f046010aed025662e6a2c7874f8.tar.gz |
- This makes no sense with non-ipv6 builds. (and fixes lot of issues with misconfigured servers)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index e64aac0f1a..0f95990a76 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -300,19 +300,21 @@ connect_errexit: /* {{{ php_fopen_do_pasv */ -static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, int ip_size, char **phoststart TSRMLS_DC) +static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart TSRMLS_DC) { char tmp_line[512]; int result, i; unsigned short portno; char *tpath, *ttpath, *hoststart=NULL; +#ifdef HAVE_IPV6 /* We try EPSV first, needed for IPv6 and works on some IPv4 servers */ php_stream_write_string(stream, "EPSV\r\n"); result = GET_FTP_RESULT(stream); /* check if we got a 229 response */ if (result != 229) { +#endif /* EPSV failed, let's try PASV */ php_stream_write_string(stream, "PASV\r\n"); result = GET_FTP_RESULT(stream); @@ -357,6 +359,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, int ip_siz tpath++; /* pull out the LSB of the port */ portno += (unsigned short) strtoul(tpath, &ttpath, 10); +#ifdef HAVE_IPV6 } else { /* parse epsv command (|||6446|) */ for (i = 0, tpath = tmp_line + 4; *tpath; tpath++) { @@ -372,6 +375,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, int ip_siz /* pull out the port */ portno = (unsigned short) strtoul(tpath + 1, &ttpath, 10); } +#endif if (ttpath == NULL) { /* didn't get correct response from EPSV/PASV */ |