diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2019-02-22 10:42:50 +0300 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2019-03-19 23:32:52 +0300 |
commit | c83e5238a7bd5e860e24536ce05140087a6532c8 (patch) | |
tree | 9cd757c1245abc3c969dbdd80411234a3de26bce /redis.c | |
parent | 09f3abb6a32596d5a6b7fec1a80d733682bdfce3 (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.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -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); } |