X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_request_pool.c;h=de7950486f8237a1ca9bea335d5b84bde60b99eb;hp=7e3e1b802942d80e7f7cf25bc83cef4f4e7a4928;hb=517336efe27e1f8e58e36352478a6d9ffdcdf378;hpb=50546d76a9bf44bba6237df7c8101be125bc929a diff --git a/php_http_request_pool.c b/php_http_request_pool.c index 7e3e1b8..de79504 100644 --- a/php_http_request_pool.c +++ b/php_http_request_pool.c @@ -1,8 +1,16 @@ - -#include "php_http.h" - -#include -#include +/* + +--------------------------------------------------------------------+ + | PECL :: http | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2004-2011, Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#include "php_http_api.h" PHP_HTTP_API php_http_request_pool_t *php_http_request_pool_init(php_http_request_pool_t *h, php_http_request_pool_ops_t *ops, php_http_resource_factory_t *rf, void *init_arg TSRMLS_DC) { @@ -49,9 +57,7 @@ PHP_HTTP_API void php_http_request_pool_dtor(php_http_request_pool_t *h) zend_llist_clean(&h->requests.finished); zend_llist_clean(&h->requests.attached); - if (h->persistent_handle_id) { - zval_ptr_dtor(&h->persistent_handle_id); - } + php_http_resource_factory_free(&h->rf); } PHP_HTTP_API void php_http_request_pool_free(php_http_request_pool_t **h) { @@ -427,7 +433,7 @@ PHP_METHOD(HttpRequestPool, wait) timeout_val.tv_sec = (time_t) timeout; timeout_val.tv_usec = PHP_HTTP_USEC(timeout) % PHP_HTTP_MCROSEC; - RETURN_SUCCESS(php_http_request_pool_wait(obj->pool, timeout ? &timeout_val : NULL)); + RETURN_SUCCESS(php_http_request_pool_wait(obj->pool, timeout > 0 ? &timeout_val : NULL)); } RETURN_FALSE; } @@ -559,8 +565,18 @@ PHP_MINIT_FUNCTION(http_request_pool) memcpy(&php_http_request_pool_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_http_request_pool_object_handlers.clone_obj = NULL; - zend_class_implements(php_http_request_pool_class_entry TSRMLS_CC, 3, spl_ce_Countable, zend_ce_iterator, php_http_fluently_callable_class_entry); + zend_class_implements(php_http_request_pool_class_entry TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); return SUCCESS; } + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +