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. */
| 1421 | * that is exported by a module and is not handled by Redis itself. |
| 1422 | * The function returns 0 on error, 1 on success. */ |
| 1423 | int rewriteModuleObject(rio *r, robj *key, robj *o) { |
| 1424 | RedisModuleIO io; |
| 1425 | moduleValue *mv = o->ptr; |
| 1426 | moduleType *mt = mv->type; |
| 1427 | moduleInitIOContext(io,mt,r,key); |
| 1428 | mt->aof_rewrite(&io,key,mv->value); |
| 1429 | if (io.ctx) { |
| 1430 | moduleFreeContext(io.ctx); |
| 1431 | zfree(io.ctx); |
| 1432 | } |
| 1433 | return io.error ? 0 : 1; |
| 1434 | } |
| 1435 | |
| 1436 | /* This function is called by the child rewriting the AOF file to read |
| 1437 | * the difference accumulated from the parent into a buffer, that is |
no test coverage detected