@@ -29,17 +29,16 @@ extern zend_class_entry *redis_exception_ce;
2929 */
3030typedef struct {
3131 zend_async_event_callback_t event ; /* must be first for the callback cast */
32- redis_async_pool * rp ; /* owning pool, NULL once destroyed */
32+ redis_async_pool * pool ; /* owning pool, NULL once destroyed */
3333 RedisSock * conn ; /* checked-out conn, NULL if released */
34- zend_ulong coro_key ; /* key in rp ->bindings */
34+ zend_ulong coro_key ; /* key in pool ->bindings */
3535 bool has_coro_callback ; /* registered with the coroutine event */
3636} redis_pool_binding_t ;
3737
3838struct _redis_async_pool {
3939 zend_async_pool_t * async_pool ; /* physical RedisSock resources */
4040 HashTable * bindings ; /* coro_key -> redis_pool_binding_t* */
4141 HashTable * opts ; /* dup'd ctor options; factory re-applies */
42- zend_object * wrapper ; /* PHP pool wrapper (getPool()), lazy */
4342 long db_default ; /* configured DB; drift pins the conn */
4443 uint32_t mux_reserve ; /* connections reserved for multiplexing */
4544};
@@ -205,19 +204,19 @@ static void redis_pool_binding_on_coroutine_finish(
205204 redis_pool_binding_t * binding = (redis_pool_binding_t * )callback ;
206205
207206 /* Pool already destroyed — nothing to do. */
208- if (binding -> rp == NULL ) {
207+ if (binding -> pool == NULL ) {
209208 return ;
210209 }
211210
212211 if (binding -> conn != NULL ) {
213212 zval conn_zval ;
214213 ZVAL_PTR (& conn_zval , binding -> conn );
215- ZEND_ASYNC_POOL_RELEASE (binding -> rp -> async_pool , & conn_zval );
214+ ZEND_ASYNC_POOL_RELEASE (binding -> pool -> async_pool , & conn_zval );
216215 binding -> conn = NULL ;
217216 }
218217
219- if (binding -> rp -> bindings != NULL ) {
220- zend_hash_index_del (binding -> rp -> bindings , binding -> coro_key );
218+ if (binding -> pool -> bindings != NULL ) {
219+ zend_hash_index_del (binding -> pool -> bindings , binding -> coro_key );
221220 }
222221}
223222
@@ -300,7 +299,6 @@ int redis_pool_create(redis_object *redis, HashTable *opts)
300299 rp -> opts = zend_array_dup (opts );
301300 rp -> db_default = redis -> sock ? redis -> sock -> dbNumber : 0 ;
302301 rp -> mux_reserve = (uint32_t )mux ;
303- rp -> wrapper = NULL ;
304302
305303 redis -> pool = rp ;
306304 return SUCCESS ;
@@ -329,7 +327,7 @@ void redis_pool_destroy(redis_object *redis)
329327 efree (binding );
330328 } else {
331329 /* Coroutine callback will no-op; dispose frees the binding. */
332- binding -> rp = NULL ;
330+ binding -> pool = NULL ;
333331 }
334332 } ZEND_HASH_FOREACH_END ();
335333
@@ -338,11 +336,6 @@ void redis_pool_destroy(redis_object *redis)
338336 rp -> bindings = NULL ;
339337 }
340338
341- if (rp -> wrapper != NULL ) {
342- OBJ_RELEASE (rp -> wrapper );
343- rp -> wrapper = NULL ;
344- }
345-
346339 if (rp -> async_pool != NULL ) {
347340 ZEND_ASYNC_POOL_CLOSE (rp -> async_pool );
348341 ZEND_ASYNC_EVENT_RELEASE (& rp -> async_pool -> event );
@@ -397,7 +390,7 @@ RedisSock *redis_pool_acquire_conn(redis_object *redis, int no_throw)
397390 binding -> event .callback = redis_pool_binding_on_coroutine_finish ;
398391 binding -> event .dispose = redis_pool_binding_dispose ;
399392 binding -> event .ref_count = 1 ;
400- binding -> rp = rp ;
393+ binding -> pool = rp ;
401394 binding -> conn = Z_PTR (resource );
402395 binding -> coro_key = coro_key ;
403396
0 commit comments