Call the module type callback in order to rewrite a data type * that is exported by a module and is not handled by Redis itself. * The function returns 0 on error, 1 on success. */
| 1520 | * that is exported by a module and is not handled by Redis itself. |
| 1521 | * The function returns 0 on error, 1 on success. */ |
| 1522 | int rewriteModuleObject(rio *r, robj *key, robj *o) { |
| 1523 | RedisModuleIO io; |
| 1524 | moduleValue *mv = (moduleValue*)ptrFromObj(o); |
| 1525 | moduleType *mt = mv->type; |
| 1526 | moduleInitIOContext(io,mt,r,key); |
| 1527 | mt->aof_rewrite(&io,key,mv->value); |
| 1528 | if (io.ctx) { |
| 1529 | moduleFreeContext(io.ctx); |
| 1530 | zfree(io.ctx); |
| 1531 | } |
| 1532 | return io.error ? 0 : 1; |
| 1533 | } |
| 1534 | |
| 1535 | /* This function is called by the child rewriting the AOF file to read |
| 1536 | * the difference accumulated from the parent into a buffer, that is |
no test coverage detected