MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_ReplyWithSimpleString

Function RM_ReplyWithSimpleString

app/redis-6.2.6/src/module.c:1529–1536  ·  view source on GitHub ↗

Reply with a simple string (`+... \r\n` in RESP protocol). This replies * are suitable only when sending a small non-binary string with small * overhead, like "OK" or similar replies. * * The function always returns REDISMODULE_OK. */

Source from the content-addressed store, hash-verified

1527 *
1528 * The function always returns REDISMODULE_OK. */
1529int RM_ReplyWithSimpleString(RedisModuleCtx *ctx, const char *msg) {
1530 client *c = moduleGetReplyClient(ctx);
1531 if (c == NULL) return REDISMODULE_OK;
1532 addReplyProto(c,"+",1);
1533 addReplyProto(c,msg,strlen(msg));
1534 addReplyProto(c,"\r\n",2);
1535 return REDISMODULE_OK;
1536}
1537
1538/* Reply with an array type of 'len' elements. However 'len' other calls
1539 * to `ReplyWith*` style functions must follow in order to emit the elements

Callers

nothing calls this directly

Calls 2

moduleGetReplyClientFunction · 0.85
addReplyProtoFunction · 0.85

Tested by

no test coverage detected