Helper function for the MODULE and HELLO command: send the list of the * loaded modules to the client. */
| 8872 | /* Helper function for the MODULE and HELLO command: send the list of the |
| 8873 | * loaded modules to the client. */ |
| 8874 | void 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|...]" */ |
no test coverage detected