From: Xinchen Hui Date: Fri, 27 Feb 2015 15:35:37 +0000 (+0800) Subject: Merge branch 'PHP-5.6' X-Git-Tag: PRE_PHP7_EREG_MYSQL_REMOVALS~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=794a28832dcfe59fc1ad82a8dda8e3b569ed5637;p=php Merge branch 'PHP-5.6' Conflicts: ext/soap/soap.c --- 794a28832dcfe59fc1ad82a8dda8e3b569ed5637 diff --cc ext/soap/soap.c index 63de00049b,6f56216aa3..3a27f7a7b4 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@@ -2580,39 -2562,45 +2580,39 @@@ static int do_request(zval *this_ptr, x return FALSE; } - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_TYPE_PP(trace) == IS_LONG && Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_request", buf, buf_size, 1); + if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL && - Z_LVAL_P(trace) > 0) { ++ Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) { + add_property_stringl(this_ptr, "__last_request", buf, buf_size); } - INIT_ZVAL(func); - ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1,0); - ALLOC_INIT_ZVAL(params[0]); - ZVAL_STRINGL(params[0], buf, buf_size, 1); - ALLOC_INIT_ZVAL(params[1]); + ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1); + ZVAL_STRINGL(¶ms[0], buf, buf_size); if (location == NULL) { - ZVAL_NULL(params[1]); + ZVAL_NULL(¶ms[1]); } else { - ZVAL_STRING(params[1], location, 1); + ZVAL_STRING(¶ms[1], location); } - ALLOC_INIT_ZVAL(params[2]); if (action == NULL) { - ZVAL_NULL(params[2]); + ZVAL_NULL(¶ms[2]); } else { - ZVAL_STRING(params[2], action, 1); + ZVAL_STRING(¶ms[2], action); } - ALLOC_INIT_ZVAL(params[3]); - ZVAL_LONG(params[3], version); + ZVAL_LONG(¶ms[3], version); + ZVAL_LONG(¶ms[4], one_way); - ALLOC_INIT_ZVAL(params[4]); - ZVAL_LONG(params[4], one_way); - - if (call_user_function(NULL, &this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) { - add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL TSRMLS_CC); + if (call_user_function(NULL, this_ptr, &func, response, 5, params) != SUCCESS) { + add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL); ret = FALSE; } else if (Z_TYPE_P(response) != IS_STRING) { - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == FAILURE) { - add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC); + if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) == NULL) { + add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL); } ret = FALSE; - } else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && - Z_TYPE_PP(trace) == IS_LONG && Z_LVAL_PP(trace) > 0) { - add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1); + } else if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL && - Z_LVAL_P(trace) > 0) { ++ Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) { + add_property_str(this_ptr, "__last_response", zend_string_copy(Z_STR_P(response))); } + zval_ptr_dtor(&func); zval_ptr_dtor(¶ms[4]); zval_ptr_dtor(¶ms[3]); zval_ptr_dtor(¶ms[2]); @@@ -2908,20 -2903,24 +2908,20 @@@ PHP_METHOD(SoapClient, __call } /* Add default headers */ - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) { - HashTable *default_headers = Z_ARRVAL_P(*tmp); + this_ptr = getThis(); - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL) { ++ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL && Z_TYPE_P(tmp) == IS_ARRAY) { + HashTable *default_headers = Z_ARRVAL_P(tmp); if (soap_headers) { if (!free_soap_headers) { - HashTable *t = emalloc(sizeof(HashTable)); - zend_hash_init(t, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(t, soap_headers, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); - soap_headers = t; + soap_headers = zend_array_dup(soap_headers); free_soap_headers = 1; } - zend_hash_internal_pointer_reset(default_headers); - while (zend_hash_get_current_data(default_headers, (void**)&tmp) == SUCCESS) { - Z_ADDREF_PP(tmp); - zend_hash_next_index_insert(soap_headers, tmp, sizeof(zval *), NULL); - zend_hash_move_forward(default_headers); - } + ZEND_HASH_FOREACH_VAL(default_headers, tmp) { + Z_ADDREF_P(tmp); + zend_hash_next_index_insert(soap_headers, tmp); + } ZEND_HASH_FOREACH_END(); } else { - soap_headers = Z_ARRVAL_P(*tmp); + soap_headers = Z_ARRVAL_P(tmp); free_soap_headers = 0; } }