com php-src: Remove passwd handler from struct when not needed: ext/curl/interface.c ext/curl/php_curl.h
| From: | Pierrick Charron | Date: | Wed, 02 Jan 2013 02:12:02 +0000 |
| Subject: | com php-src: Remove passwd handler from struct when not needed: ext/curl/interface.c ext/curl/php_curl.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70839@lists.php.net to get a copy of this message | ||
Commit: 343a9199bbbf4f63b02099ceef27ef9881d8aa9f
Author: Pierrick Charron <pierrick@php.net> Tue, 1 Jan 2013 21:12:02 -0500
Parents: a666285bc2488b7f7362368c388e41428610ad1d
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=343a9199bbbf4f63b02099ceef27ef9881d8aa9f
Log:
Remove passwd handler from struct when not needed
CURLOPT_PASSWDFUNCTION was removed in cURL 7.15..5, the passwd field
will not be used for version greater than this one
Changed paths:
M ext/curl/interface.c
M ext/curl/php_curl.h
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 125094c..e0c95ef 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -3267,9 +3267,11 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
if (ch->handlers->write_header->func_name) {
zval_ptr_dtor(&ch->handlers->write_header->func_name);
}
+#if CURLOPT_PASSWDFUNCTION != 0
if (ch->handlers->passwd) {
zval_ptr_dtor(&ch->handlers->passwd);
}
+#endif
if (ch->handlers->std_err) {
zval_ptr_dtor(&ch->handlers->std_err);
}
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index 3ae7060..5c24fc1 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -135,7 +135,9 @@ typedef struct {
php_curl_write *write;
php_curl_write *write_header;
php_curl_read *read;
+#if CURLOPT_PASSWDFUNCTION != 0
zval *passwd;
+#endif
zval *std_err;
php_curl_progress *progress;
#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */