Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fd08839a
Commit
fd08839a
authored
Aug 06, 2015
by
antirez
Browse files
Client structure comments improved.
parent
3e6d4d59
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.h
View file @
fd08839a
...
...
@@ -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
;
/*
n
umber of multi bulk arguments left to read */
long
bulklen
;
/*
l
ength 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
;
/*
N
umber of multi bulk arguments left to read
.
*/
long
bulklen
;
/*
L
ength 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
;
/*
t
ime of the last interaction, used for timeout */
time_t
ctime
;
/* Client creation time
.
*/
time_t
lastinteraction
;
/*
T
ime of the last interaction, used for timeout */
time_t
obuf_soft_limit_reached_time
;
int
flags
;
/* C
LIENT_SLAVE | CLIENT_MONITOR | CLIENT_MULTI ..
. */
int
authenticated
;
/*
w
hen requirepass is non-NULL */
int
replstate
;
/*
r
eplication state if this is a slave */
int
flags
;
/* C
lient flags: CLIENT_* macros
. */
int
authenticated
;
/*
W
hen requirepass is non-NULL
.
*/
int
replstate
;
/*
R
eplication state if this is a slave
.
*/
int
repl_put_online_on_ack
;
/* Install slave write handler on ACK. */
int
repldbfd
;
/*
r
eplication DB file descriptor */
off_t
repldboff
;
/*
r
eplication DB file offset */
off_t
repldbsize
;
/*
r
eplication DB file size */
sds
replpreamble
;
/*
r
eplication DB preamble. */
long
long
reploff
;
/*
r
eplication offset if this is our master */
long
long
repl_ack_off
;
/*
r
eplication ack offset, if this is a slave */
long
long
repl_ack_time
;
/*
r
eplication ack time, if this is a slave */
int
repldbfd
;
/*
R
eplication DB file descriptor
.
*/
off_t
repldboff
;
/*
R
eplication DB file offset
.
*/
off_t
repldbsize
;
/*
R
eplication DB file size
.
*/
sds
replpreamble
;
/*
R
eplication DB preamble. */
long
long
reploff
;
/*
R
eplication offset if this is our master
.
*/
long
long
repl_ack_off
;
/*
R
eplication ack offset, if this is a slave
.
*/
long
long
repl_ack_time
;
/*
R
eplication 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
];
/*
m
aster run id if
this
is a master */
char
replrunid
[
CONFIG_RUN_ID_SIZE
+
1
];
/*
M
aster 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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment