PSUBSCRIBE pattern [pattern ...] */
| 389 | |
| 390 | /* PSUBSCRIBE pattern [pattern ...] */ |
| 391 | void psubscribeCommand(client *c) { |
| 392 | int j; |
| 393 | serverAssert(GlobalLocksAcquired()); |
| 394 | if ((c->flags & CLIENT_DENY_BLOCKING) && !(c->flags & CLIENT_MULTI)) { |
| 395 | /** |
| 396 | * A client that has CLIENT_DENY_BLOCKING flag on |
| 397 | * expect a reply per command and so can not execute subscribe. |
| 398 | * |
| 399 | * Notice that we have a special treatment for multi because of |
| 400 | * backword compatibility |
| 401 | */ |
| 402 | addReplyError(c, "PSUBSCRIBE isn't allowed for a DENY BLOCKING client"); |
| 403 | return; |
| 404 | } |
| 405 | |
| 406 | for (j = 1; j < c->argc; j++) |
| 407 | pubsubSubscribePattern(c,c->argv[j]); |
| 408 | c->flags |= CLIENT_PUBSUB; |
| 409 | } |
| 410 | |
| 411 | /* PUNSUBSCRIBE [pattern [pattern ...]] */ |
| 412 | void punsubscribeCommand(client *c) { |
nothing calls this directly
no test coverage detected