From: antirez Date: Mon, 23 Jan 2012 09:36:07 +0000 (+0100) Subject: Merge branch 'unstable' into limits X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/890da62eea16bbf67be0c92cf16eba191f8e828e?ds=sidebyside;hp=-c Merge branch 'unstable' into limits --- 890da62eea16bbf67be0c92cf16eba191f8e828e diff --combined src/redis.h index 42ade8fc,8889779a..8b262171 --- a/src/redis.h +++ b/src/redis.h @@@ -20,6 -20,7 +20,7 @@@ #include #include #include + #include #include "ae.h" /* Event driven programming library */ #include "sds.h" /* Dynamic safe strings */ @@@ -146,12 -147,6 +147,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 */ @@@ -311,7 -306,6 +312,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 ... */ @@@ -790,7 -784,6 +791,7 @@@ sds getClientInfoString(redisClient *cl 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, ...) @@@ -1169,5 -1162,6 +1170,6 @@@ void _redisAssert(char *estr, char *fil void _redisPanic(char *msg, char *file, int line); void bugReportStart(void); void redisLogObjectDebugInfo(robj *o); - + void sigsegvHandler(int sig, siginfo_t *info, void *secret); + sds genRedisInfoString(char *section); #endif