com php-src: remove false dup: ext/curl/multi.c
| From: | Xinchen Hui | Date: | Mon, 08 Jan 2018 04:56:08 +0000 |
| Subject: | com php-src: remove false dup: ext/curl/multi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100811@lists.php.net to get a copy of this message | ||
Commit: 4c3c7117e4624ea8e4ae20918b39714fb0235ca4
Author: Xinchen Hui <laruence@gmail.com> Mon, 8 Jan 2018 12:55:57 +0800
Parents: 88b8cd7385c57791cc75128e84943316ec426584
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c3c7117e4624ea8e4ae20918b39714fb0235ca4
Log:
remove false dup
Changed paths:
M ext/curl/multi.c
Diff:
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index e78e154..707384f 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -79,7 +79,6 @@ PHP_FUNCTION(curl_multi_add_handle)
zval *z_ch;
php_curlm *mh;
php_curl *ch;
- zval tmp_val;
CURLMcode error = CURLM_OK;
ZEND_PARSE_PARAMETERS_START(2,2)
@@ -97,10 +96,8 @@ PHP_FUNCTION(curl_multi_add_handle)
_php_curl_cleanup_handle(ch);
- /* we want to create a copy of this zval that we store in the multihandle structure element
"easyh" */
- ZVAL_DUP(&tmp_val, z_ch);
-
- zend_llist_add_element(&mh->easyh, &tmp_val);
+ GC_ADDREF(Z_RES_P(z_ch));
+ zend_llist_add_element(&mh->easyh, z_ch);
error = curl_multi_add_handle(mh->multi, ch->cp);
SAVE_CURLM_ERROR(mh, error);
@@ -520,11 +517,8 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t
num_hea
} else if (!Z_ISUNDEF(retval)) {
if (CURL_PUSH_DENY != zval_get_long(&retval)) {
rval = CURL_PUSH_OK;
-
- /* we want to create a copy of this zval that we store in the multihandle structure element
"easyh" */
- zval tmp_val;
- ZVAL_DUP(&tmp_val, &pz_ch);
- zend_llist_add_element(&mh->easyh, &tmp_val);
+ GC_ADDREF(Z_RES(pz_ch));
+ zend_llist_add_element(&mh->easyh, &pz_ch);
} else {
/* libcurl will free this easy handle, avoid double free */
ch->cp = NULL;
@@ -533,6 +527,7 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
return rval;
}
+/* }}} */
#endif