Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2019-02-22 10:42:50 +0300
committermichael-grunder <michael.grunder@gmail.com>2019-03-19 23:32:52 +0300
commitc83e5238a7bd5e860e24536ce05140087a6532c8 (patch)
tree9cd757c1245abc3c969dbdd80411234a3de26bce /redis.c
parent09f3abb6a32596d5a6b7fec1a80d733682bdfce3 (diff)
Refactor connection pooling code.
Move logic of searching+creating connection pool resource to `redis_sock_get_connection_pool`. Don't close streams in ZEND_RSRC_DTOR_FUNC because all of them stored in `EG(persistent_list)` and will be destroyed by PHP engine.
Diffstat (limited to 'redis.c')
-rw-r--r--redis.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/redis.c b/redis.c
index a88753f2..eaeaf1ce 100644
--- a/redis.c
+++ b/redis.c
@@ -716,16 +716,9 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster TSRMLS_DC)
zend_declare_class_constant_stringl(ce, "BEFORE", 6, "before", 6 TSRMLS_CC);
}
-static void
-redis_pconnect_dtor(void *ptr TSRMLS_DC)
-{
- php_stream_pclose(*(php_stream **)ptr);
-}
-
static ZEND_RSRC_DTOR_FUNC(redis_connections_pool_dtor)
{
if (res->ptr) {
- zend_llist_apply(res->ptr, redis_pconnect_dtor TSRMLS_CC);
zend_llist_destroy(res->ptr);
pefree(res->ptr, 1);
}