mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fixed compilation of new rio.c changes (typos and so forth.)
This commit is contained in:
parent
46738646d4
commit
8491f1d9fd
@ -717,7 +717,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
|||||||
size_t len;
|
size_t len;
|
||||||
unsigned int i;
|
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) {
|
if (rdbtype == REDIS_RDB_TYPE_STRING) {
|
||||||
/* Read string value */
|
/* Read string value */
|
||||||
if ((o = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL;
|
if ((o = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL;
|
||||||
@ -1039,7 +1039,7 @@ int rdbLoad(char *filename) {
|
|||||||
|
|
||||||
/* Serve the clients from time to time */
|
/* Serve the clients from time to time */
|
||||||
if (!(loops++ % 1000)) {
|
if (!(loops++ % 1000)) {
|
||||||
loadingProgress(rdbTell(&rdb));
|
loadingProgress(rioTell(&rdb));
|
||||||
aeProcessEvents(server.el, AE_FILE_EVENTS|AE_DONT_WAIT);
|
aeProcessEvents(server.el, AE_FILE_EVENTS|AE_DONT_WAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include "rio.h"
|
#include "rio.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l);
|
||||||
|
|
||||||
/* Returns 1 or 0 for success/failure. */
|
/* Returns 1 or 0 for success/failure. */
|
||||||
static size_t rioBufferWrite(rio *r, const void *buf, size_t len) {
|
static size_t rioBufferWrite(rio *r, const void *buf, size_t len) {
|
||||||
r->io.buffer.ptr = sdscatlen(r->io.buffer.ptr,(char*)buf,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
|
/* This function can be installed both in memory and file streams when checksum
|
||||||
* computation is needed. */
|
* computation is needed. */
|
||||||
void rioGenericUpdateChecksum(rio *r, const void *buf, size_t len) {
|
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 ---------------------------
|
/* ------------------------------ Higher level interface ---------------------------
|
||||||
|
@ -16,7 +16,7 @@ struct _rio {
|
|||||||
* data that was read or written so far. The method should be designed so that
|
* 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
|
* 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. */
|
* 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 */
|
/* The current checksum */
|
||||||
uint64_t cksum;
|
uint64_t cksum;
|
||||||
@ -40,13 +40,13 @@ typedef struct _rio rio;
|
|||||||
* if needed. */
|
* if needed. */
|
||||||
|
|
||||||
inline size_t rioWrite(rio *r, const void *buf, size_t len) {
|
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);
|
return r->write(r,buf,len);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline size_t rioRead(rio *r, void *buf, size_t len) {
|
inline size_t rioRead(rio *r, void *buf, size_t len) {
|
||||||
if (r->read(r,buf,len) == 1) {
|
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 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user