mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
Static buffer in client struct has a constant size
This commit is contained in:
@ -11,11 +11,7 @@ int listMatchObjects(void *a, void *b) {
|
||||
}
|
||||
|
||||
redisClient *createClient(int fd) {
|
||||
redisClient *c;
|
||||
|
||||
/* Allocate more space to hold a static write buffer. */
|
||||
c = zmalloc(sizeof(redisClient)+REDIS_REPLY_CHUNK_BYTES);
|
||||
c->buflen = REDIS_REPLY_CHUNK_BYTES;
|
||||
redisClient *c = zmalloc(sizeof(redisClient));
|
||||
c->bufpos = 0;
|
||||
|
||||
anetNonBlock(NULL,fd);
|
||||
@ -84,7 +80,7 @@ robj *dupLastObjectIfNeeded(list *reply) {
|
||||
}
|
||||
|
||||
int _addReplyToBuffer(redisClient *c, char *s, size_t len) {
|
||||
size_t available = c->buflen-c->bufpos;
|
||||
size_t available = sizeof(c->buf)-c->bufpos;
|
||||
|
||||
/* If there already are entries in the reply list, we cannot
|
||||
* add anything more to the static buffer. */
|
||||
|
Reference in New Issue
Block a user