MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ldbRedisProtocolToHuman

Function ldbRedisProtocolToHuman

src/scripting.cpp:2345–2360  ·  view source on GitHub ↗

Get Redis protocol from 'reply' and appends it in human readable form to * the passed SDS string 'o'. * * Note that the SDS string is passed by reference (pointer of pointer to * char*) so that we can return a modified pointer, as for SDS semantics. */

Source from the content-addressed store, hash-verified

2343 * Note that the SDS string is passed by reference (pointer of pointer to
2344 * char*) so that we can return a modified pointer, as for SDS semantics. */
2345char *ldbRedisProtocolToHuman(sds *o, char *reply) {
2346 char *p = reply;
2347 switch(*p) {
2348 case ':': p = ldbRedisProtocolToHuman_Int(o,reply); break;
2349 case '$': p = ldbRedisProtocolToHuman_Bulk(o,reply); break;
2350 case '+': p = ldbRedisProtocolToHuman_Status(o,reply); break;
2351 case '-': p = ldbRedisProtocolToHuman_Status(o,reply); break;
2352 case '*': p = ldbRedisProtocolToHuman_MultiBulk(o,reply); break;
2353 case '~': p = ldbRedisProtocolToHuman_Set(o,reply); break;
2354 case '%': p = ldbRedisProtocolToHuman_Map(o,reply); break;
2355 case '_': p = ldbRedisProtocolToHuman_Null(o,reply); break;
2356 case '#': p = ldbRedisProtocolToHuman_Bool(o,reply); break;
2357 case ',': p = ldbRedisProtocolToHuman_Double(o,reply); break;
2358 }
2359 return p;
2360}
2361
2362/* The following functions are helpers for ldbRedisProtocolToHuman(), each
2363 * take care of a given Redis return type. */

Callers 4

ldbLogRedisReplyFunction · 0.85

Tested by

no test coverage detected