add max-age to http\Cookie
[m6w6/ext-http] / php_http_curl_client_pool.c
index ddac5c18552f015b13047694fb009dbb7c9bb7a3..4edff74e99341166225dd26056bc13a46616c9d8 100644 (file)
@@ -62,7 +62,7 @@ static void php_http_curl_client_pool_responsehandler(php_http_client_pool_t *po
                        zval **request;
 
                        if (CURLE_OK != msg->data.result) {
-                               php_http_curl_client_storage_t *st = get_storage(msg->easy_handle);
+                               php_http_curl_client_storage_t *st = php_http_curl_client_get_storage(msg->easy_handle);
                                php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT, "%s; %s (%s)", curl_easy_strerror(msg->data.result), STR_PTR(st->errorbuffer), STR_PTR(st->url));
                        }
 
@@ -527,11 +527,7 @@ zend_object_value php_http_curl_client_pool_object_new_ex(zend_class_entry *ce,
 
        o = ecalloc(1, sizeof(php_http_client_pool_object_t));
        zend_object_std_init((zend_object *) o, ce TSRMLS_CC);
-#if PHP_VERSION_ID < 50339
-       zend_hash_copy(((zend_object *) o)->properties, &(ce->default_properties), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*));
-#else
        object_properties_init((zend_object *) o, ce);
-#endif
 
        if (!(o->pool = p)) {
                o->pool = php_http_client_pool_init(NULL, &php_http_curl_client_pool_ops, NULL, NULL TSRMLS_CC);
@@ -560,16 +556,26 @@ PHP_MINIT_FUNCTION(http_curl_client_pool)
        return SUCCESS;
 }
 
+#if PHP_HTTP_HAVE_EVENT
 PHP_RINIT_FUNCTION(http_curl_client_pool)
 {
-#if PHP_HTTP_HAVE_EVENT
        if (!PHP_HTTP_G->curl.event_base && !(PHP_HTTP_G->curl.event_base = event_base_new())) {
                return FAILURE;
        }
+       return SUCCESS;
+}
 #endif
 
+#if PHP_HTTP_HAVE_EVENT
+PHP_RSHUTDOWN_FUNCTION(http_curl_client_pool)
+{
+       if (PHP_HTTP_G->curl.event_base) {
+               event_base_free(PHP_HTTP_G->curl.event_base);
+               PHP_HTTP_G->curl.event_base = NULL;
+       }
        return SUCCESS;
 }
+#endif
 
 #endif /* PHP_HTTP_HAVE_CURL */