PSUBSCRIBE pattern [pattern ...] */
| 370 | |
| 371 | /* PSUBSCRIBE pattern [pattern ...] */ |
| 372 | void psubscribeCommand(client *c) { |
| 373 | int j; |
| 374 | if ((c->flags & CLIENT_DENY_BLOCKING) && !(c->flags & CLIENT_MULTI)) { |
| 375 | /** |
| 376 | * A client that has CLIENT_DENY_BLOCKING flag on |
| 377 | * expect a reply per command and so can not execute subscribe. |
| 378 | * |
| 379 | * Notice that we have a special treatment for multi because of |
| 380 | * backword compatibility |
| 381 | */ |
| 382 | addReplyError(c, "PSUBSCRIBE isn't allowed for a DENY BLOCKING client"); |
| 383 | return; |
| 384 | } |
| 385 | |
| 386 | for (j = 1; j < c->argc; j++) |
| 387 | pubsubSubscribePattern(c,c->argv[j]); |
| 388 | c->flags |= CLIENT_PUBSUB; |
| 389 | } |
| 390 | |
| 391 | /* PUNSUBSCRIBE [pattern [pattern ...]] */ |
| 392 | void punsubscribeCommand(client *c) { |
nothing calls this directly
no test coverage detected