X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_message.c;h=ead53476ebed117277e8fc0a842ddb2a10e8b91d;hb=c5da027b7eca8eae5304e536539c2be05e716009;hp=a99a0bb2ecf42ca70e7ab45c4f6379e480b5d62d;hpb=8d05291f42b3b42159b3fe91492aa4862f3d4405;p=m6w6%2Fext-http diff --git a/php_http_message.c b/php_http_message.c index a99a0bb..ead5347 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -10,11 +10,7 @@ +--------------------------------------------------------------------+ */ -#include "php_http.h" - -#include
-#include -#include +#include "php_http_api.h" PHP_HTTP_API zend_bool php_http_message_info_callback(php_http_message_t **message, HashTable **headers, php_http_info_t *info TSRMLS_DC) { @@ -1143,7 +1139,7 @@ static zval **php_http_message_object_get_prop_ptr(zval *object, zval *member, c if (SUCCESS == php_http_message_object_get_prophandler(Z_STRVAL_P(copy), Z_STRLEN_P(copy), &handler)) { zval_ptr_dtor(©); - return &php_http_property_proxy_init(NULL, object, member TSRMLS_CC)->myself; + return &php_http_property_proxy_init(NULL, object, member, NULL TSRMLS_CC)->myself; } zval_ptr_dtor(©); @@ -1157,18 +1153,16 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t zval *return_value, *copy = php_http_ztyp(IS_STRING, member); if (SUCCESS == php_http_message_object_get_prophandler(Z_STRVAL_P(copy), Z_STRLEN_P(copy), &handler)) { - if (type == BP_VAR_W) { - zval_ptr_dtor(©); + if (type == BP_VAR_R) { + ALLOC_ZVAL(return_value); + Z_SET_REFCOUNT_P(return_value, 0); + Z_UNSET_ISREF_P(return_value); + + handler->read(obj, return_value TSRMLS_CC); + } else { zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index"); - return NULL; + return_value = NULL; } - - ALLOC_ZVAL(return_value); - Z_SET_REFCOUNT_P(return_value, 0); - Z_UNSET_ISREF_P(return_value); - - handler->read(obj, return_value TSRMLS_CC); - } else { return_value = zend_get_std_object_handlers()->read_property(object, member, type, literal_key TSRMLS_CC); }