Closed vnsavage closed 2 years ago
yes, nice catch. much appreciated.
if (response == MMC_OK) { (*((int *)param))++;
the default case is false. the casting in success case is a little awkward, i'm not currently sure, why is it this way other than we take (void )param, instead of zval param
the suggested change seems to work. fixes the bug.
Thanks! For the success case - yeah, I think an int is passed to the handler so that's why the (void ) is casted to (int *) and incremented afterwards.
In mmc_flush_handler the return param is a pointer to integer and ZVAL_FALSE should not be used as it results in memory corruption. The failure case is not supposed to modify the return param.
The problem can be reproduced by disabling flush_all in the Memcached server.