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