SUBSCRIBE channel [channel ...] */
| 337 | |
| 338 | /* SUBSCRIBE channel [channel ...] */ |
| 339 | void subscribeCommand(client *c) { |
| 340 | int j; |
| 341 | if ((c->flags & CLIENT_DENY_BLOCKING) && !(c->flags & CLIENT_MULTI)) { |
| 342 | /** |
| 343 | * A client that has CLIENT_DENY_BLOCKING flag on |
| 344 | * expect a reply per command and so can not execute subscribe. |
| 345 | * |
| 346 | * Notice that we have a special treatment for multi because of |
| 347 | * backword compatibility |
| 348 | */ |
| 349 | addReplyError(c, "SUBSCRIBE isn't allowed for a DENY BLOCKING client"); |
| 350 | return; |
| 351 | } |
| 352 | |
| 353 | for (j = 1; j < c->argc; j++) |
| 354 | pubsubSubscribeChannel(c,c->argv[j]); |
| 355 | c->flags |= CLIENT_PUBSUB; |
| 356 | } |
| 357 | |
| 358 | /* UNSUBSCRIBE [channel [channel ...]] */ |
| 359 | void unsubscribeCommand(client *c) { |
nothing calls this directly
no test coverage detected