| 2467 | } |
| 2468 | |
| 2469 | void clientCommand(client *c) { |
| 2470 | listNode *ln; |
| 2471 | listIter li; |
| 2472 | |
| 2473 | if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { |
| 2474 | const char *help[] = { |
| 2475 | "CACHING (YES|NO)", |
| 2476 | " Enable/disable tracking of the keys for next command in OPTIN/OPTOUT modes.", |
| 2477 | "GETREDIR", |
| 2478 | " Return the client ID we are redirecting to when tracking is enabled.", |
| 2479 | "GETNAME", |
| 2480 | " Return the name of the current connection.", |
| 2481 | "ID", |
| 2482 | " Return the ID of the current connection.", |
| 2483 | "INFO", |
| 2484 | " Return information about the current client connection.", |
| 2485 | "KILL <ip:port>", |
| 2486 | " Kill connection made from <ip:port>.", |
| 2487 | "KILL <option> <value> [<option> <value> [...]]", |
| 2488 | " Kill connections. Options are:", |
| 2489 | " * ADDR (<ip:port>|<unixsocket>:0)", |
| 2490 | " Kill connections made from the specified address", |
| 2491 | " * LADDR (<ip:port>|<unixsocket>:0)", |
| 2492 | " Kill connections made to specified local address", |
| 2493 | " * TYPE (normal|master|replica|pubsub)", |
| 2494 | " Kill connections by type.", |
| 2495 | " * USER <username>", |
| 2496 | " Kill connections authenticated by <username>.", |
| 2497 | " * SKIPME (YES|NO)", |
| 2498 | " Skip killing current connection (default: yes).", |
| 2499 | "LIST [options ...]", |
| 2500 | " Return information about client connections. Options:", |
| 2501 | " * TYPE (NORMAL|MASTER|REPLICA|PUBSUB)", |
| 2502 | " Return clients of specified type.", |
| 2503 | "UNPAUSE", |
| 2504 | " Stop the current client pause, resuming traffic.", |
| 2505 | "PAUSE <timeout> [WRITE|ALL]", |
| 2506 | " Suspend all, or just write, clients for <timout> milliseconds.", |
| 2507 | "REPLY (ON|OFF|SKIP)", |
| 2508 | " Control the replies sent to the current connection.", |
| 2509 | "SETNAME <name>", |
| 2510 | " Assign the name <name> to the current connection.", |
| 2511 | "UNBLOCK <clientid> [TIMEOUT|ERROR]", |
| 2512 | " Unblock the specified blocked client.", |
| 2513 | "TRACKING (ON|OFF) [REDIRECT <id>] [BCAST] [PREFIX <prefix> [...]]", |
| 2514 | " [OPTIN] [OPTOUT]", |
| 2515 | " Control server assisted client side caching.", |
| 2516 | "TRACKINGINFO", |
| 2517 | " Report tracking status for the current connection.", |
| 2518 | NULL |
| 2519 | }; |
| 2520 | addReplyHelp(c, help); |
| 2521 | } else if (!strcasecmp(c->argv[1]->ptr,"id") && c->argc == 2) { |
| 2522 | /* CLIENT ID */ |
| 2523 | addReplyLongLong(c,c->id); |
| 2524 | } else if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) { |
| 2525 | /* CLIENT INFO */ |
| 2526 | sds o = catClientInfoString(sdsempty(), c); |
nothing calls this directly
no test coverage detected