struct sharedObjectsStruct {
robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *pong, *space,
struct sharedObjectsStruct {
robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *pong, *space,
- *colon, *minus1, *nullbulk, *nullmultibulk,
+ *colon, *nullbulk, *nullmultibulk,
*emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
*outofrangeerr, *plus,
*select0, *select1, *select2, *select3, *select4,
*emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
*outofrangeerr, *plus,
*select0, *select1, *select2, *select3, *select4,
shared.nullmultibulk = createObject(REDIS_STRING,sdsnew("*-1\r\n"));
shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n"));
/* no such key */
shared.nullmultibulk = createObject(REDIS_STRING,sdsnew("*-1\r\n"));
shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n"));
/* no such key */
shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
"-ERR Operation against a key holding the wrong kind of value\r\n"));
shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
"-ERR Operation against a key holding the wrong kind of value\r\n"));
static int loadDb(char *filename) {
FILE *fp;
char buf[REDIS_LOADBUF_LEN]; /* Try to use this buffer instead of */
char vbuf[REDIS_LOADBUF_LEN]; /* malloc() when the element is small */
char *key = NULL, *val = NULL;
uint32_t klen,vlen,dbid;
static int loadDb(char *filename) {
FILE *fp;
char buf[REDIS_LOADBUF_LEN]; /* Try to use this buffer instead of */
char vbuf[REDIS_LOADBUF_LEN]; /* malloc() when the element is small */
char *key = NULL, *val = NULL;
uint32_t klen,vlen,dbid;
if (type == REDIS_EOF) break;
/* Handle SELECT DB opcode as a special case */
if (type == REDIS_SELECTDB) {
if (type == REDIS_EOF) break;
/* Handle SELECT DB opcode as a special case */
if (type == REDIS_SELECTDB) {