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

Function addHashIteratorCursorToReply

app/redis-6.2.6/src/t_hash.c:875–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873}
874
875static void addHashIteratorCursorToReply(client *c, hashTypeIterator *hi, int what) {
876 if (hi->encoding == OBJ_ENCODING_ZIPLIST) {
877 unsigned char *vstr = NULL;
878 unsigned int vlen = UINT_MAX;
879 long long vll = LLONG_MAX;
880
881 hashTypeCurrentFromZiplist(hi, what, &vstr, &vlen, &vll);
882 if (vstr)
883 addReplyBulkCBuffer(c, vstr, vlen);
884 else
885 addReplyBulkLongLong(c, vll);
886 } else if (hi->encoding == OBJ_ENCODING_HT) {
887 sds value = hashTypeCurrentFromHashTable(hi, what);
888 addReplyBulkCBuffer(c, value, sdslen(value));
889 } else {
890 serverPanic("Unknown hash encoding");
891 }
892}
893
894void genericHgetallCommand(client *c, int flags) {
895 robj *o;

Callers 2

genericHgetallCommandFunction · 0.85

Calls 5

addReplyBulkCBufferFunction · 0.85
addReplyBulkLongLongFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected