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

Function addReplyLoadedModules

src/module.cpp:8874–8889  ·  view source on GitHub ↗

Helper function for the MODULE and HELLO command: send the list of the * loaded modules to the client. */

Source from the content-addressed store, hash-verified

8872/* Helper function for the MODULE and HELLO command: send the list of the
8873 * loaded modules to the client. */
8874void addReplyLoadedModules(client *c) {
8875 dictIterator *di = dictGetIterator(modules);
8876 dictEntry *de;
8877
8878 addReplyArrayLen(c,dictSize(modules));
8879 while ((de = dictNext(di)) != NULL) {
8880 sds name = (sds)dictGetKey(de);
8881 struct RedisModule *module = (RedisModule*)dictGetVal(de);
8882 addReplyMapLen(c,2);
8883 addReplyBulkCString(c,"name");
8884 addReplyBulkCBuffer(c,name,sdslen(name));
8885 addReplyBulkCString(c,"ver");
8886 addReplyLongLong(c,module->ver);
8887 }
8888 dictReleaseIterator(di);
8889}
8890
8891/* Helper for genModulesInfoString(): given a list of modules, return
8892 * am SDS string in the form "[modulename|modulename2|...]" */

Callers 2

moduleCommandFunction · 0.85
helloCommandFunction · 0.85

Calls 9

addReplyArrayLenFunction · 0.85
addReplyMapLenFunction · 0.85
addReplyBulkCStringFunction · 0.85
addReplyBulkCBufferFunction · 0.85
sdslenFunction · 0.85
addReplyLongLongFunction · 0.85
dictGetIteratorFunction · 0.70
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected