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

Function rioWriteBulkObject

app/redis-6.2.6/src/aof.c:979–989  ·  view source on GitHub ↗

Delegate writing an object to writing a bulk string or bulk long long. * This is not placed in rio.c since that adds the server.h dependency. */

Source from the content-addressed store, hash-verified

977/* Delegate writing an object to writing a bulk string or bulk long long.
978 * This is not placed in rio.c since that adds the server.h dependency. */
979int rioWriteBulkObject(rio *r, robj *obj) {
980 /* Avoid using getDecodedObject to help copy-on-write (we are often
981 * in a child process when this function is called). */
982 if (obj->encoding == OBJ_ENCODING_INT) {
983 return rioWriteBulkLongLong(r,(long)obj->ptr);
984 } else if (sdsEncodedObject(obj)) {
985 return rioWriteBulkString(r,obj->ptr,sdslen(obj->ptr));
986 } else {
987 serverPanic("Unknown string encoding");
988 }
989}
990
991/* Emit the commands needed to rebuild a list object.
992 * The function returns 0 on error, 1 on success. */

Callers 9

rewriteListObjectFunction · 0.85
rewriteSetObjectFunction · 0.85
rewriteSortedSetObjectFunction · 0.85
rewriteHashObjectFunction · 0.85
rewriteStreamObjectFunction · 0.85
rewriteAppendOnlyFileRioFunction · 0.85
RM_EmitAOFFunction · 0.85

Calls 3

rioWriteBulkLongLongFunction · 0.85
rioWriteBulkStringFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected