com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/curl/interface.c
| From: | Pierrick Charron | Date: | Tue, 26 Jul 2016 23:20:12 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93405@lists.php.net to get a copy of this message | ||
Commit: 31ed322b0699e188f418a74adeec4c7e4ddd0bae
Author: Pierrick Charron <pierrick@php.net> Tue, 26 Jul 2016 19:20:12 -0400
Parents: 2fba6468374a15efc82aaac8cbfc600b29c5404f 24d8f6ed7c583c82d6ed63080d235474f8afec6a
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=31ed322b0699e188f418a74adeec4c7e4ddd0bae
Log:
Merge branch 'PHP-5.6' into PHP-7.0
Changed paths:
MM ext/curl/interface.c
Diff:
diff --cc ext/curl/interface.c
index 7d085de,dc4a971..648d8ce6
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@@ -2647,23 -2542,27 +2647,25 @@@ static int _php_curl_setopt(php_curl *c
return FAILURE;
}
- for (zend_hash_internal_pointer_reset(ph);
- zend_hash_get_current_data(ph, (void **) ¤t) == SUCCESS;
- zend_hash_move_forward(ph)
- ) {
- SEPARATE_ZVAL(current);
- convert_to_string_ex(current);
-
- slist = curl_slist_append(slist, Z_STRVAL_PP(current));
+ ZEND_HASH_FOREACH_VAL(ph, current) {
+ ZVAL_DEREF(current);
+ val = zval_get_string(current);
+ slist = curl_slist_append(slist, ZSTR_VAL(val));
+ zend_string_release(val);
if (!slist) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
+ php_error_docref(NULL, E_WARNING, "Could not build curl_slist");
return 1;
}
- }
+ } ZEND_HASH_FOREACH_END();
- 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);
+ if (slist) {
- if (Z_REFCOUNT_P(ch->clone) <= 1) {
- zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct
curl_slist *), NULL);
++ if ((*ch->clone) == 1) {
++ zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
+ } else {
- zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist
*), NULL);
++ zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
+ }
}
+
error = curl_easy_setopt(ch->cp, option, slist);
break;