summaryrefslogtreecommitdiff
path: root/ext/standard/ftp_fopen_wrapper.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-08-05 23:09:30 +0200
committerNikita Popov <nikic@php.net>2016-08-05 23:09:30 +0200
commita2a2ea18feea8945be7a7f02f384f015fa47076a (patch)
tree72a46086bcc5ff500ab8e03f235d5db8a1816e8d /ext/standard/ftp_fopen_wrapper.c
parent807e81937b290ddb71152196aae3bbaca9a53c7e (diff)
parent65056e9d6c74adef89332080b5458fd4850fb3b7 (diff)
downloadphp-git-a2a2ea18feea8945be7a7f02f384f015fa47076a.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
Conflicts: ext/standard/ftp_fopen_wrapper.c
Diffstat (limited to 'ext/standard/ftp_fopen_wrapper.c')
-rw-r--r--ext/standard/ftp_fopen_wrapper.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 82875777a0..8d0f19c516 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -728,18 +728,6 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_context_set(datastream, context);
- if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
- php_stream_xport_crypto_enable(datastream, 1) < 0)) {
-
- php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
- php_stream_close(datastream);
- datastream = NULL;
- goto opendir_errexit;
- }
-
-
php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
@@ -752,6 +740,17 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
+ php_stream_context_set(datastream, context);
+ if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(datastream, 1) < 0)) {
+
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
+ php_stream_close(datastream);
+ datastream = NULL;
+ goto opendir_errexit;
+ }
+
php_url_free(resource);
dirsdata = emalloc(sizeof *dirsdata);