Client structure comments improved.

This commit is contained in:
antirez 2015-08-06 09:41:11 +02:00
parent 3e6d4d599a
commit fd08839a3a

View File

@ -538,40 +538,40 @@ typedef struct readyList {
* Clients are taken in a linked list. */ * Clients are taken in a linked list. */
typedef struct client { typedef struct client {
uint64_t id; /* Client incremental unique ID. */ uint64_t id; /* Client incremental unique ID. */
int fd; int fd; /* Client socket. */
redisDb *db; redisDb *db; /* Pointer to currently SELECTed DB. */
int dictid; int dictid; /* ID of the currently SELECTed DB. */
robj *name; /* As set by CLIENT SETNAME */ robj *name; /* As set by CLIENT SETNAME. */
sds querybuf; sds querybuf; /* Buffer we use to accumulate client queries. */
size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size */ size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size. */
int argc; int argc; /* Num of arguments of current command. */
robj **argv; robj **argv; /* Arguments of current command. */
struct redisCommand *cmd, *lastcmd; struct redisCommand *cmd, *lastcmd; /* Last command executed. */
int reqtype; int reqtype; /* Request protocol type: PROTO_REQ_* */
int multibulklen; /* number of multi bulk arguments left to read */ int multibulklen; /* Number of multi bulk arguments left to read. */
long bulklen; /* length of bulk argument in multi bulk request */ long bulklen; /* Length of bulk argument in multi bulk request. */
list *reply; list *reply; /* List of reply objects to send to the client. */
unsigned long long reply_bytes; /* Tot bytes of objects in reply list */ unsigned long long reply_bytes; /* Tot bytes of objects in reply list. */
size_t sentlen; /* Amount of bytes already sent in the current size_t sentlen; /* Amount of bytes already sent in the current
buffer or object being sent. */ buffer or object being sent. */
time_t ctime; /* Client creation time */ time_t ctime; /* Client creation time. */
time_t lastinteraction; /* time of the last interaction, used for timeout */ time_t lastinteraction; /* Time of the last interaction, used for timeout */
time_t obuf_soft_limit_reached_time; time_t obuf_soft_limit_reached_time;
int flags; /* CLIENT_SLAVE | CLIENT_MONITOR | CLIENT_MULTI ... */ int flags; /* Client flags: CLIENT_* macros. */
int authenticated; /* when requirepass is non-NULL */ int authenticated; /* When requirepass is non-NULL. */
int replstate; /* replication state if this is a slave */ int replstate; /* Replication state if this is a slave. */
int repl_put_online_on_ack; /* Install slave write handler on ACK. */ int repl_put_online_on_ack; /* Install slave write handler on ACK. */
int repldbfd; /* replication DB file descriptor */ int repldbfd; /* Replication DB file descriptor. */
off_t repldboff; /* replication DB file offset */ off_t repldboff; /* Replication DB file offset. */
off_t repldbsize; /* replication DB file size */ off_t repldbsize; /* Replication DB file size. */
sds replpreamble; /* replication DB preamble. */ sds replpreamble; /* Replication DB preamble. */
long long reploff; /* replication offset if this is our master */ 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_off; /* Replication ack offset, if this is a slave. */
long long repl_ack_time;/* replication ack time, 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 long long psync_initial_offset; /* FULLRESYNC reply offset other slaves
copying this slave output buffer copying this slave output buffer
should use. */ 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_listening_port; /* As configured with: SLAVECONF listening-port */
int slave_capa; /* Slave capabilities: SLAVE_CAPA_* bitwise OR. */ int slave_capa; /* Slave capabilities: SLAVE_CAPA_* bitwise OR. */
multiState mstate; /* MULTI/EXEC state */ multiState mstate; /* MULTI/EXEC state */