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

Function addReplyLoadedModules

app/redis-6.2.6/src/module.c:8674–8689  ·  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

8672/* Helper function for the MODULE and HELLO command: send the list of the
8673 * loaded modules to the client. */
8674void addReplyLoadedModules(client *c) {
8675 dictIterator *di = dictGetIterator(modules);
8676 dictEntry *de;
8677
8678 addReplyArrayLen(c,dictSize(modules));
8679 while ((de = dictNext(di)) != NULL) {
8680 sds name = dictGetKey(de);
8681 struct RedisModule *module = dictGetVal(de);
8682 addReplyMapLen(c,2);
8683 addReplyBulkCString(c,"name");
8684 addReplyBulkCBuffer(c,name,sdslen(name));
8685 addReplyBulkCString(c,"ver");
8686 addReplyLongLong(c,module->ver);
8687 }
8688 dictReleaseIterator(di);
8689}
8690
8691/* Helper for genModulesInfoString(): given a list of modules, return
8692 * am SDS string in the form "[modulename|modulename2|...]" */

Callers 2

helloCommandFunction · 0.85
moduleCommandFunction · 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