diff options
author | Jakub Zelenka <bukka@php.net> | 2016-04-03 19:56:15 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-04-03 19:56:15 +0100 |
commit | 6ac8bc4ecb1fdf112eefdd16d2c4f971e7ac232a (patch) | |
tree | 3612c90af5d656357045e107ccac556863e929a3 /ext/curl/interface.c | |
parent | df85331220ac60391d5f8d82c42a6c699f47fca1 (diff) | |
parent | 80015ba741fc857074050086db6c7b2a4716d6d5 (diff) | |
download | php-git-6ac8bc4ecb1fdf112eefdd16d2c4f971e7ac232a.tar.gz |
Merge branch 'openssl_error_store' of github.com:bukka/php-src into openssl_error_store
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r-- | ext/curl/interface.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index bd611ce42f..564d9fcb1c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -157,7 +157,8 @@ static void _php_curl_close(zend_resource *rsrc); #define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s) - 1, (zend_long) v); #define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s) - 1, (double) v); #define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s) - 1, (char *) (v ? v : "")); -#define CAASTR(s, v) add_assoc_str_ex(return_value, s, sizeof(s) - 1, v ? v : ZSTR_EMPTY_ALLOC()); +#define CAASTR(s, v) add_assoc_str_ex(return_value, s, sizeof(s) - 1, \ + v ? zend_string_copy(v) : ZSTR_EMPTY_ALLOC()); #define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s) -1 , (zval *) v); #if defined(PHP_WIN32) || defined(__GNUC__) @@ -2188,7 +2189,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ #endif # if defined(ZTS) if (option == CURLOPT_DNS_USE_GLOBAL_CACHE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled"); + php_error_docref(NULL, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled"); return 1; } # endif @@ -2475,7 +2476,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ } } ZEND_HASH_FOREACH_END(); - zend_hash_index_update_ptr(ch->to_free->slist, option, slist); + if ((*ch->clone) == 1) { + zend_hash_index_update_ptr(ch->to_free->slist, option, slist); + } else { + zend_hash_next_index_insert_ptr(ch->to_free->slist, slist); + } error = curl_easy_setopt(ch->cp, option, slist); @@ -3032,7 +3037,7 @@ PHP_FUNCTION(curl_getinfo) } #endif if (ch->header.str) { - CAASTR("request_header", zend_string_copy(ch->header.str)); + CAASTR("request_header", ch->header.str); } } else { switch (option) { |