diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-02-13 17:54:23 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-02-13 17:54:23 +0400 |
commit | 40e053e7f333b5fc3f4c75c964600666810cc969 (patch) | |
tree | 3436d014c44e3eab00107e67b10229ec0262dbb6 /ext/standard/ftp_fopen_wrapper.c | |
parent | 6306918ed2c9d87cf5fadc62d210a797a794926e (diff) | |
download | php-git-40e053e7f333b5fc3f4c75c964600666810cc969.tar.gz |
Use better data structures (incomplete)
Diffstat (limited to 'ext/standard/ftp_fopen_wrapper.c')
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index df03772c39..b0b2c6ba8c 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -423,7 +423,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa int result = 0, use_ssl, use_ssl_on_data=0; php_stream *reuseid=NULL; size_t file_size = 0; - zval **tmpzval; + zval *tmpzval; int allow_overwrite = 0; int read_write = 0; char *transport; @@ -452,7 +452,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (context && - php_stream_context_get_option(context, "ftp", "proxy", &tmpzval) == SUCCESS) { + (tmpzval = php_stream_context_get_option(context, "ftp", "proxy")) != NULL) { if (read_write == 1) { /* Use http wrapper to proxy ftp request */ return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC); @@ -497,8 +497,8 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } } else if (read_write == 2) { /* when writing file (but not appending), it must NOT exist, unless a context option exists which allows it */ - if (context && php_stream_context_get_option(context, "ftp", "overwrite", &tmpzval) == SUCCESS) { - allow_overwrite = Z_LVAL_PP(tmpzval); + if (context && (tmpzval = php_stream_context_get_option(context, "ftp", "overwrite")) != NULL) { + allow_overwrite = Z_LVAL_P(tmpzval); } if (result <= 299 && result >= 200) { if (allow_overwrite) { @@ -528,13 +528,13 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa if (read_write == 1) { /* set resume position if applicable */ if (context && - php_stream_context_get_option(context, "ftp", "resume_pos", &tmpzval) == SUCCESS && - Z_TYPE_PP(tmpzval) == IS_LONG && - Z_LVAL_PP(tmpzval) > 0) { - php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_PP(tmpzval)); + (tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL && + Z_TYPE_P(tmpzval) == IS_LONG && + Z_LVAL_P(tmpzval) > 0) { + php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_P(tmpzval)); result = GET_FTP_RESULT(stream); if (result < 300 || result > 399) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %ld", Z_LVAL_PP(tmpzval)); + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %ld", Z_LVAL_P(tmpzval)); goto errexit; } } |