提交 1bcb45d1 编写于 作者: A antirez

Fixed compilation of new rio.c changes (typos and so forth.)

上级 b4b923b0
......@@ -717,7 +717,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
size_t len;
unsigned int i;
redisLog(REDIS_DEBUG,"LOADING OBJECT %d (at %d)\n",rdbtype,rdbTell(rdb));
redisLog(REDIS_DEBUG,"LOADING OBJECT %d (at %d)\n",rdbtype,rioTell(rdb));
if (rdbtype == REDIS_RDB_TYPE_STRING) {
/* Read string value */
if ((o = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL;
......@@ -1039,7 +1039,7 @@ int rdbLoad(char *filename) {
/* Serve the clients from time to time */
if (!(loops++ % 1000)) {
loadingProgress(rdbTell(&rdb));
loadingProgress(rioTell(&rdb));
aeProcessEvents(server.el, AE_FILE_EVENTS|AE_DONT_WAIT);
}
......
......@@ -18,6 +18,8 @@
#include "rio.h"
#include "util.h"
uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l);
/* Returns 1 or 0 for success/failure. */
static size_t rioBufferWrite(rio *r, const void *buf, size_t len) {
r->io.buffer.ptr = sdscatlen(r->io.buffer.ptr,(char*)buf,len);
......@@ -86,7 +88,7 @@ void rioInitWithBuffer(rio *r, sds s) {
/* This function can be installed both in memory and file streams when checksum
* computation is needed. */
void rioGenericUpdateChecksum(rio *r, const void *buf, size_t len) {
r->checksum = crc64(r->checksum,buf,len);
r->cksum = crc64(r->cksum,buf,len);
}
/* ------------------------------ Higher level interface ---------------------------
......
......@@ -16,7 +16,7 @@ struct _rio {
* data that was read or written so far. The method should be designed so that
* can be called with the current checksum, and the buf and len fields pointing
* to the new block of data to add to the checksum computation. */
void (*update_cksum)(struct _rio *, void *buf, size_t len);
void (*update_cksum)(struct _rio *, const void *buf, size_t len);
/* The current checksum */
uint64_t cksum;
......@@ -40,13 +40,13 @@ typedef struct _rio rio;
* if needed. */
inline size_t rioWrite(rio *r, const void *buf, size_t len) {
if (r->udpate_cksum) r->update_cksum(r,buf,len);
if (r->update_cksum) r->update_cksum(r,buf,len);
return r->write(r,buf,len);
}
inline size_t rioRead(rio *r, void *buf, size_t len) {
if (r->read(r,buf,len) == 1) {
if (r->udpate_cksum) r->update_cksum(r,buf,len);
if (r->update_cksum) r->update_cksum(r,buf,len);
return 1;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册