X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/f42e2f1bd791e4b3fdfa75c620dc9386b7cfea1e..498dc5557c31fc9a65a36f2e8da9accfa72fbc5a:/src/redis.h?ds=sidebyside diff --git a/src/redis.h b/src/redis.h index 1ad62400..42ade8fc 100644 --- a/src/redis.h +++ b/src/redis.h @@ -60,6 +60,7 @@ #define REDIS_MAX_QUERYBUF_LEN (1024*1024*1024) /* 1GB max query buffer. */ #define REDIS_IOBUF_LEN (1024*16) /* Generic I/O buffer size */ #define REDIS_REPLY_CHUNK_BYTES (16*1024) /* 16k output buffer */ +#define REDIS_INLINE_MAX_SIZE (1024*64) /* Max size of inline reads */ #define REDIS_MBULK_BIG_ARG (1024*32) /* Hash table parameters */ @@ -145,6 +146,12 @@ #define REDIS_REQ_INLINE 1 #define REDIS_REQ_MULTIBULK 2 +/* Client classes for client limits, currently used only for + * the max-client-output-buffer limit implementation. */ +#define REDIS_CLIENT_LIMIT_CLASS_NORMAL 0 +#define REDIS_CLIENT_LIMIT_CLASS_SLAVE 1 +#define REDIS_CLIENT_LIMIT_CLASS_PUBSUB 2 + /* Slave replication state - slave side */ #define REDIS_REPL_NONE 0 /* No active replication */ #define REDIS_REPL_CONNECT 1 /* Must connect to master */ @@ -304,6 +311,7 @@ typedef struct redisClient { int multibulklen; /* number of multi bulk arguments left to read */ long bulklen; /* length of bulk argument in multi bulk request */ list *reply; + unsigned long reply_bytes; /* Tot bytes of objects in reply list */ int sentlen; time_t lastinteraction; /* time of the last interaction, used for timeout */ int flags; /* REDIS_SLAVE | REDIS_MONITOR | REDIS_MULTI ... */ @@ -518,6 +526,7 @@ struct redisServer { int cfd; /* Cluster bus lisetning socket */ list *clients; /* List of active clients */ list *slaves, *monitors; /* List of slaves and MONITORs */ + redisClient *current_client; /* Current client, only used on crash report */ char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */ /* RDB / AOF loading information */ int loading; /* We are loading data from disk if true */ @@ -781,6 +790,7 @@ sds getClientInfoString(redisClient *client); sds getAllClientsInfoString(void); void rewriteClientCommandVector(redisClient *c, int argc, ...); void rewriteClientCommandArgument(redisClient *c, int i, robj *newval); +unsigned long getClientOutputBufferMemoryUsage(redisClient *c); #ifdef __GNUC__ void addReplyErrorFormat(redisClient *c, const char *fmt, ...) @@ -1158,5 +1168,6 @@ void _redisAssertWithInfo(redisClient *c, robj *o, char *estr, char *file, int l void _redisAssert(char *estr, char *file, int line); void _redisPanic(char *msg, char *file, int line); void bugReportStart(void); +void redisLogObjectDebugInfo(robj *o); #endif