- even better use a object struct member for that crap
authorMichael Wallner <mike@php.net>
Tue, 12 Apr 2005 15:36:00 +0000 (15:36 +0000)
committerMichael Wallner <mike@php.net>
Tue, 12 Apr 2005 15:36:00 +0000 (15:36 +0000)
http.c
http_message_object.c
php_http.h
php_http_message_object.h

diff --git a/http.c b/http.c
index 9aa6878561b580a09a9111250246b8d363f52d22..50f387b81363d3b98eeaf69d2669483e4b742631 100644 (file)
--- 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;
 }
 /* }}} */
index 17c9492b7e8a36d7304a0a900f5742c193620086..2e968b808b600f3632c89873ad9921ec8d8048e9 100644 (file)
@@ -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));
index 0c00e662093555c77117ab091e9e325738f857c3..ca291374e2759e04f6efbc41a80fa53f5b2529dc 100644 (file)
@@ -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)
 
index 399aca3c008b12d9f44128a5590de4f8473544cf..5e87b59b43e846d8728fdc7cea4a08c5b2f75526 100644 (file)
@@ -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;