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