provide RTLD_LAZY compatibility
authorMichael Wallner <mike@php.net>
Wed, 15 Jul 2015 08:56:34 +0000 (10:56 +0200)
committerMichael Wallner <mike@php.net>
Wed, 15 Jul 2015 08:56:34 +0000 (10:56 +0200)
Closes gh-issue #4

Avoid using php_peristent_handle_abandon function pointer.
See also
https://github.com/m6w6/ext-raphf/commit/177e968e112ea8030065d5d7a4907bcaefa9b085

php_http_client.c
php_http_client_curl.c

index f64731e..5d78803 100644 (file)
@@ -507,7 +507,7 @@ static PHP_METHOD(HttpClient, __construct)
                        php_persistent_handle_factory_t *pf;
 
                        if ((pf = php_persistent_handle_concede(NULL, driver->client_name, persistent_handle_name, NULL, NULL))) {
-                               rf = php_resource_factory_init(NULL, php_persistent_handle_get_resource_factory_ops(), pf, (void (*)(void *)) php_persistent_handle_abandon);
+                               rf = php_persistent_handle_resource_factory_init(NULL, pf);
                        }
                }
 
index a9b8c7f..b91fe48 100644 (file)
@@ -2136,7 +2136,7 @@ static php_resource_factory_t *create_rf(php_http_client_t *h, php_http_client_e
        }
 
        /* only if the client itself is setup for persistence */
-       if (h->rf->dtor == (void (*)(void*)) php_persistent_handle_abandon) {
+       if (php_resource_factory_is_persistent(h->rf)) {
                zend_string *id;
                char *id_str = NULL;
                size_t id_len;
@@ -2158,7 +2158,7 @@ static php_resource_factory_t *create_rf(php_http_client_t *h, php_http_client_e
        }
 
        if (pf) {
-               rf = php_resource_factory_init(NULL, php_persistent_handle_get_resource_factory_ops(), pf, (void (*)(void*)) php_persistent_handle_abandon);
+               rf = php_persistent_handle_resource_factory_init(NULL, pf);
        } else {
                rf = php_resource_factory_init(NULL, &php_http_curle_resource_factory_ops, NULL, NULL);
        }