Send a pubsub message of type "message" to the client. * Normally 'msg' is a Redis object containing the string to send as * message. However if the caller sets 'msg' as NULL, it will be able * to send a special message (for instance an Array type) by using the * addReply*() API family. */
| 42 | * to send a special message (for instance an Array type) by using the |
| 43 | * addReply*() API family. */ |
| 44 | void addReplyPubsubMessage(client *c, robj *channel, robj *msg) { |
| 45 | if (c->resp == 2) |
| 46 | addReply(c,shared.mbulkhdr[3]); |
| 47 | else |
| 48 | addReplyPushLen(c,3); |
| 49 | addReply(c,shared.messagebulk); |
| 50 | addReplyBulk(c,channel); |
| 51 | if (msg) addReplyBulk(c,msg); |
| 52 | } |
| 53 | |
| 54 | /* Send a pubsub message of type "pmessage" to the client. The difference |
| 55 | * with the "message" type delivered by addReplyPubsubMessage() is that |
no test coverage detected