From: Michael Wallner Date: Tue, 12 Apr 2005 15:36:00 +0000 (+0000) Subject: - even better use a object struct member for that crap X-Git-Tag: RELEASE_0_8_0~77 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=27d26668aa55316946f376d1fc4a8014c5fb4de7;p=m6w6%2Fext-http - even better use a object struct member for that crap --- diff --git a/http.c b/http.c index 9aa6878..50f387b 100644 --- a/http.c +++ b/http.c @@ -283,8 +283,6 @@ PHP_RSHUTDOWN_FUNCTION(http) phpstr_dtor(&HTTP_G(curlbuf)); #endif - zval_dtor(&HTTP_G(message_object_tmp_property)); - return SUCCESS; } /* }}} */ diff --git a/http_message_object.c b/http_message_object.c index 17c9492..2e968b8 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -28,8 +28,6 @@ #ifdef ZEND_ENGINE_2 -ZEND_EXTERN_MODULE_GLOBALS(http); - #define http_message_object_declare_default_properties() _http_message_object_declare_default_properties(TSRMLS_C) static inline void _http_message_object_declare_default_properties(TSRMLS_D); #define http_message_object_read_prop _http_message_object_read_prop @@ -105,6 +103,7 @@ static void _http_message_object_free(zend_object *object TSRMLS_DC) if (o->message) { http_message_free(o->message); } + zval_dtor(&o->_tmp_property); efree(o); } @@ -112,7 +111,7 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type { getObjectEx(http_message_object, obj, object); http_message *msg = obj->message; - zval *return_value = &HTTP_G(message_object_tmp_property); + zval *return_value = &obj->_tmp_property; if (!EG(scope) || !instanceof_function(EG(scope), obj->zo.ce TSRMLS_CC)) { zend_error(E_WARNING, "Cannot access protected property %s::$%s", obj->zo.ce->name, Z_STRVAL_P(member)); diff --git a/php_http.h b/php_http.h index 0c00e66..ca29137 100644 --- a/php_http.h +++ b/php_http.h @@ -47,7 +47,6 @@ ZEND_BEGIN_MODULE_GLOBALS(http) char curlerr[CURL_ERROR_SIZE + 1]; # endif zend_llist to_free; - zval message_object_tmp_property; #endif /* HTTP_HAVE_CURL */ ZEND_END_MODULE_GLOBALS(http) diff --git a/php_http_message_object.h b/php_http_message_object.h index 399aca3..5e87b59 100644 --- a/php_http_message_object.h +++ b/php_http_message_object.h @@ -24,6 +24,7 @@ typedef struct { zend_object zo; http_message *message; + zval _tmp_property; } http_message_object; extern zend_class_entry *http_message_object_ce;