X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_object.c;h=aa63cab0b47fc8b98c325a6371a313606912954d;hb=3e819ac22cb929e7f1b6df482b51a36a7e12dc60;hp=f741e65754ea7bdeebe2976d9c9861ff985444c9;hpb=edc84b40eb2c5be04492fa98fec5833a030782eb;p=m6w6%2Fext-http diff --git a/http_message_object.c b/http_message_object.c index f741e65..aa63cab 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -34,8 +34,6 @@ extern PHPAPI zend_class_entry *spl_ce_Countable; # endif #endif -ZEND_EXTERN_MODULE_GLOBALS(http); - #define HTTP_BEGIN_ARGS(method, ret_ref, req_args) HTTP_BEGIN_ARGS_EX(HttpMessage, method, ret_ref, req_args) #define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpMessage, method, ret_ref) #define HTTP_MESSAGE_ME(method, visibility) PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility) @@ -370,10 +368,7 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va } #endif - ALLOC_ZVAL(cpy); - *cpy = *value; - zval_copy_ctor(cpy); - INIT_PZVAL(cpy); + cpy = zval_copy(Z_TYPE_P(value), value); #ifdef WONKY switch (h) @@ -458,7 +453,7 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va #endif break; } - zval_ptr_dtor(&cpy); + zval_free(&cpy); } static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC) @@ -476,7 +471,7 @@ static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC) char *m_prop_name; \ int m_prop_len; \ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ - add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+4, val); \ + add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+3, val); \ efree(m_prop_name); \ } #define ASSOC_STRING(array, name, val) ASSOC_STRINGL(array, name, val, strlen(val)) @@ -485,7 +480,7 @@ static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC) char *m_prop_name; \ int m_prop_len; \ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ - add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+4, val, len, 1); \ + add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+3, val, len, 1); \ efree(m_prop_name); \ }