X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/11e0c4c55b8edd8d2226ba2e5fde989778695195..498dc5557c31fc9a65a36f2e8da9accfa72fbc5a:/src/redis.h diff --git a/src/redis.h b/src/redis.h index f3b3134e..42ade8fc 100644 --- a/src/redis.h +++ b/src/redis.h @@ -146,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 */ @@ -305,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 ... */ @@ -519,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 */ @@ -782,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, ...) @@ -1159,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