X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_message.c;h=75d7fe5396e9e4ab41c9125a040bbb559d4e4c30;hp=3d3822cfeeb8326e455e5aae29d8d1afa93e8b38;hb=1571b39b2988b27c93cfa2cd9114439784bff2d6;hpb=468e8d748d365811af4ce890fd8fc4c1f88cc08a diff --git a/php_http_message.c b/php_http_message.c index 3d3822c..75d7fe5 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -496,7 +496,6 @@ void php_http_message_free(php_http_message_t **message) static zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *rv); static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot); -static HashTable *php_http_message_object_get_props(zval *object); static zend_object_handlers php_http_message_object_handlers; static HashTable php_http_message_object_prophandlers; @@ -690,7 +689,8 @@ void php_http_message_object_reverse(zval *zmsg, zval *return_value) /* add ref, because we previously have not been a parent message */ Z_ADDREF_P(zmsg); - RETVAL_OBJECT(&objects[last]->zo, 1); + /* no addref, because we've been a parent message previously */ + RETVAL_OBJECT(&objects[last]->zo, 0); efree(objects); } else { @@ -897,7 +897,7 @@ static void php_http_message_object_write_prop(zval *object, zval *member, zval zend_string_release(member_name); } -static HashTable *php_http_message_object_get_props(zval *object) +static HashTable *php_http_message_object_get_debug_info(zval *object, int *is_temp) { zval tmp; php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object); @@ -906,13 +906,14 @@ static HashTable *php_http_message_object_get_props(zval *object) size_t ver_len, url_len = 0; PHP_HTTP_MESSAGE_OBJECT_INIT(obj); + *is_temp = 0; #define UPDATE_PROP(name_str, action_with_tmp) \ do { \ zend_property_info *pi; \ if ((pi = zend_hash_str_find_ptr(&obj->zo.ce->properties_info, name_str, lenof(name_str)))) { \ action_with_tmp; \ - zend_hash_update(props, pi->name, &tmp); \ + zend_hash_update_ind(props, pi->name, &tmp); \ } \ } while(0) @@ -1971,7 +1972,7 @@ PHP_MINIT_FUNCTION(http_message) php_http_message_object_handlers.free_obj = php_http_message_object_free; php_http_message_object_handlers.read_property = php_http_message_object_read_prop; php_http_message_object_handlers.write_property = php_http_message_object_write_prop; - php_http_message_object_handlers.get_properties = php_http_message_object_get_props; + php_http_message_object_handlers.get_debug_info = php_http_message_object_get_debug_info; php_http_message_object_handlers.get_property_ptr_ptr = NULL; zend_class_implements(php_http_message_class_entry, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);