Skip to content

Commit 78f4f50

Browse files
isagemichael-grunder
authored andcommitted
Allow to break out of subscribe loop
1 parent f78c9f4 commit 78f4f50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

redis.c

+8
Original file line numberDiff line numberDiff line change
@@ -5699,6 +5699,14 @@ PHP_REDIS_API void generic_subscribe_cmd(INTERNAL_FUNCTION_PARAMETERS, char *sub
56995699
}
57005700

57015701
/* If we have a return value, free it. Note, we could use the return value to break the subscribe loop */
5702+
if (z_ret) {
5703+
if(Z_TYPE_P(z_ret) == IS_BOOL && Z_BVAL_P(z_ret) == 0) {
5704+
zval_ptr_dtor(&z_ret);
5705+
zval_dtor(z_tab);
5706+
efree(z_tab);
5707+
break;
5708+
}
5709+
}
57025710
if(z_ret) zval_ptr_dtor(&z_ret);
57035711

57045712
/* TODO: provide a way to break out of the loop. */

0 commit comments

Comments
 (0)