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 f64731e3e907ea525f95056dc0fc06b648c66b37..5d78803154676f52248647338ffb463c88ce82ac 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 a9b8c7ffc6fe8fa3103e96d727b2301c57104919..b91fe4837467b829bd15d38c7e463ffb7b2ac9f0 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);
        }