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
| 1734 | * to the set of renamed commands. However, if the command was not renamed, |
| 1735 | * we just return "command" itself. */ |
| 1736 | char *sentinelInstanceMapCommand(sentinelRedisInstance *ri, char *command) { |
| 1737 | sds sc = sdsnew(command); |
| 1738 | if (ri->master) ri = ri->master; |
| 1739 | char *retval = dictFetchValue(ri->renamed_commands, sc); |
| 1740 | sdsfree(sc); |
| 1741 | return retval ? retval : command; |
| 1742 | } |
| 1743 | |
| 1744 | /* ============================ Config handling ============================= */ |
| 1745 |
no test coverage detected