Unregister a command filter. */
| 7624 | /* Unregister a command filter. |
| 7625 | */ |
| 7626 | int RM_UnregisterCommandFilter(RedisModuleCtx *ctx, RedisModuleCommandFilter *filter) { |
| 7627 | listNode *ln; |
| 7628 | |
| 7629 | /* A module can only remove its own filters */ |
| 7630 | if (filter->module != ctx->module) return REDISMODULE_ERR; |
| 7631 | |
| 7632 | ln = listSearchKey(moduleCommandFilters,filter); |
| 7633 | if (!ln) return REDISMODULE_ERR; |
| 7634 | listDelNode(moduleCommandFilters,ln); |
| 7635 | |
| 7636 | ln = listSearchKey(ctx->module->filters,filter); |
| 7637 | if (!ln) return REDISMODULE_ERR; /* Shouldn't happen */ |
| 7638 | listDelNode(ctx->module->filters,ln); |
| 7639 | |
| 7640 | zfree(filter); |
| 7641 | |
| 7642 | return REDISMODULE_OK; |
| 7643 | } |
| 7644 | |
| 7645 | int moduleHasCommandFilters() |
| 7646 | { |
nothing calls this directly
no test coverage detected