summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-08-06 09:41:11 +0200
committerantirez <antirez@gmail.com>2015-08-06 09:41:11 +0200
commitfd08839a3a9e8dba242886286f6d182044686e69 (patch)
treec5c93aecdaf8e4c0688b005df3b3078ec5f06003
parent3e6d4d599a07ec347ef2f77c6b292223e7be6a16 (diff)
downloadredis-fd08839a3a9e8dba242886286f6d182044686e69.tar.gz
Client structure comments improved.
-rw-r--r--src/server.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/server.h b/src/server.h
index 024b3e254..b025fbbac 100644
--- a/src/server.h
+++ b/src/server.h
@@ -538,40 +538,40 @@ typedef struct readyList {
* Clients are taken in a linked list. */
typedef struct client {
uint64_t id; /* Client incremental unique ID. */
- int fd;
- redisDb *db;
- int dictid;
- robj *name; /* As set by CLIENT SETNAME */
- sds querybuf;
- size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size */
- int argc;
- robj **argv;
- struct redisCommand *cmd, *lastcmd;
- int reqtype;
- int multibulklen; /* number of multi bulk arguments left to read */
- long bulklen; /* length of bulk argument in multi bulk request */
- list *reply;
- unsigned long long reply_bytes; /* Tot bytes of objects in reply list */
+ int fd; /* Client socket. */
+ redisDb *db; /* Pointer to currently SELECTed DB. */
+ int dictid; /* ID of the currently SELECTed DB. */
+ robj *name; /* As set by CLIENT SETNAME. */
+ sds querybuf; /* Buffer we use to accumulate client queries. */
+ size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size. */
+ int argc; /* Num of arguments of current command. */
+ robj **argv; /* Arguments of current command. */
+ struct redisCommand *cmd, *lastcmd; /* Last command executed. */
+ int reqtype; /* Request protocol type: PROTO_REQ_* */
+ int multibulklen; /* Number of multi bulk arguments left to read. */
+ long bulklen; /* Length of bulk argument in multi bulk request. */
+ list *reply; /* List of reply objects to send to the client. */
+ unsigned long long reply_bytes; /* Tot bytes of objects in reply list. */
size_t sentlen; /* Amount of bytes already sent in the current
buffer or object being sent. */
- time_t ctime; /* Client creation time */
- time_t lastinteraction; /* time of the last interaction, used for timeout */
+ time_t ctime; /* Client creation time. */
+ time_t lastinteraction; /* Time of the last interaction, used for timeout */
time_t obuf_soft_limit_reached_time;
- int flags; /* CLIENT_SLAVE | CLIENT_MONITOR | CLIENT_MULTI ... */
- int authenticated; /* when requirepass is non-NULL */
- int replstate; /* replication state if this is a slave */
+ int flags; /* Client flags: CLIENT_* macros. */
+ int authenticated; /* When requirepass is non-NULL. */
+ int replstate; /* Replication state if this is a slave. */
int repl_put_online_on_ack; /* Install slave write handler on ACK. */
- int repldbfd; /* replication DB file descriptor */
- off_t repldboff; /* replication DB file offset */
- off_t repldbsize; /* replication DB file size */
- sds replpreamble; /* replication DB preamble. */
- long long reploff; /* replication offset if this is our master */
- long long repl_ack_off; /* replication ack offset, if this is a slave */
- long long repl_ack_time;/* replication ack time, if this is a slave */
+ int repldbfd; /* Replication DB file descriptor. */
+ off_t repldboff; /* Replication DB file offset. */
+ off_t repldbsize; /* Replication DB file size. */
+ sds replpreamble; /* Replication DB preamble. */
+ long long reploff; /* Replication offset if this is our master. */
+ long long repl_ack_off; /* Replication ack offset, if this is a slave. */
+ long long repl_ack_time;/* Replication ack time, if this is a slave. */
long long psync_initial_offset; /* FULLRESYNC reply offset other slaves
copying this slave output buffer
should use. */
- char replrunid[CONFIG_RUN_ID_SIZE+1]; /* master run id if this is a master */
+ char replrunid[CONFIG_RUN_ID_SIZE+1]; /* Master run id if is a master. */
int slave_listening_port; /* As configured with: SLAVECONF listening-port */
int slave_capa; /* Slave capabilities: SLAVE_CAPA_* bitwise OR. */
multiState mstate; /* MULTI/EXEC state */