SENTINEL CONFIG GET */
| 3217 | |
| 3218 | /* SENTINEL CONFIG GET <option> */ |
| 3219 | void sentinelConfigGetCommand(client *c) { |
| 3220 | robj *o = c->argv[3]; |
| 3221 | const char *pattern = szFromObj(o); |
| 3222 | void *replylen = addReplyDeferredLen(c); |
| 3223 | int matches = 0; |
| 3224 | |
| 3225 | if (stringmatch(pattern,"resolve-hostnames",1)) { |
| 3226 | addReplyBulkCString(c,"resolve-hostnames"); |
| 3227 | addReplyBulkCString(c,sentinel.resolve_hostnames ? "yes" : "no"); |
| 3228 | matches++; |
| 3229 | } |
| 3230 | |
| 3231 | if (stringmatch(pattern, "announce-hostnames", 1)) { |
| 3232 | addReplyBulkCString(c,"announce-hostnames"); |
| 3233 | addReplyBulkCString(c,sentinel.announce_hostnames ? "yes" : "no"); |
| 3234 | matches++; |
| 3235 | } |
| 3236 | |
| 3237 | if (stringmatch(pattern, "announce-ip", 1)) { |
| 3238 | addReplyBulkCString(c,"announce-ip"); |
| 3239 | addReplyBulkCString(c,sentinel.announce_ip ? sentinel.announce_ip : ""); |
| 3240 | matches++; |
| 3241 | } |
| 3242 | |
| 3243 | if (stringmatch(pattern, "announce-port", 1)) { |
| 3244 | addReplyBulkCString(c, "announce-port"); |
| 3245 | addReplyBulkLongLong(c, sentinel.announce_port); |
| 3246 | matches++; |
| 3247 | } |
| 3248 | |
| 3249 | if (stringmatch(pattern, "sentinel-user", 1)) { |
| 3250 | addReplyBulkCString(c, "sentinel-user"); |
| 3251 | addReplyBulkCString(c, sentinel.sentinel_auth_user ? sentinel.sentinel_auth_user : ""); |
| 3252 | matches++; |
| 3253 | } |
| 3254 | |
| 3255 | if (stringmatch(pattern, "sentinel-pass", 1)) { |
| 3256 | addReplyBulkCString(c, "sentinel-pass"); |
| 3257 | addReplyBulkCString(c, sentinel.sentinel_auth_pass ? sentinel.sentinel_auth_pass : ""); |
| 3258 | matches++; |
| 3259 | } |
| 3260 | |
| 3261 | setDeferredMapLen(c, replylen, matches); |
| 3262 | } |
| 3263 | |
| 3264 | const char *sentinelFailoverStateStr(int state) { |
| 3265 | switch(state) { |
no test coverage detected