This function is used in order to send commands to Redis instances: the * commands we send from Sentinel may be renamed, a common case is a master * with CONFIG and SLAVEOF commands renamed for security concerns. In that * case we check the ri->renamed_command table (or if the instance is a slave, * we check the one of the master), and map the command that we should send * to the set of renam
| 1740 | * to the set of renamed commands. However, if the command was not renamed, |
| 1741 | * we just return "command" itself. */ |
| 1742 | const char *sentinelInstanceMapCommand(sentinelRedisInstance *ri, const char *command) { |
| 1743 | sds sc = sdsnew(command); |
| 1744 | if (ri->master) ri = ri->master; |
| 1745 | char *retval = (char*)dictFetchValue(ri->renamed_commands, sc); |
| 1746 | sdsfree(sc); |
| 1747 | return retval ? retval : command; |
| 1748 | } |
| 1749 | |
| 1750 | /* ============================ Config handling ============================= */ |
| 1751 |
no test coverage detected