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

Function addHashIteratorCursorToReply

src/t_hash.cpp:880–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

genericHgetallCommandFunction · 0.85

Calls 5

addReplyBulkCBufferFunction · 0.85
addReplyBulkLongLongFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected