-typedef struct conn {
- int conn_idx; /* connection index in the thread */
- int sfd; /* current tcp sock handler of the connection structure */
- int udpsfd; /* current udp sock handler of the connection structure*/
- int state; /* state of the connection */
- struct event event; /* event for libevent */
- short ev_flags; /* event flag for libevent */
- short which; /* which events were just triggered */
- bool change_sfd; /* whether change sfd */
-
- int *tcpsfd; /* TCP sock array */
- int total_sfds; /* how many socks in the tcpsfd array */
- int alive_sfds; /* alive socks */
- int cur_idx; /* current sock index in tcpsfd array */
-
- ms_cmdstat_t precmd; /* previous command state */
- ms_cmdstat_t currcmd; /* current command state */
-
- char *rbuf; /* buffer to read commands into */
- char *rcurr; /* but if we parsed some already, this is where we stopped */
- int rsize; /* total allocated size of rbuf */
- int rbytes; /* how much data, starting from rcur, do we have unparsed */
-
- bool readval; /* read value state, read known data size */
- int rvbytes; /* total value size need to read */
-
- char *wbuf; /* buffer to write commands out */
- char *wcurr; /* for multi-get, where we stopped */
- int wsize; /* total allocated size of wbuf */
- bool ctnwrite; /* continue to write */
-
- /* data for the mwrite state */
- struct iovec *iov;
- int iovsize; /* number of elements allocated in iov[] */
- int iovused; /* number of elements used in iov[] */
-
- struct msghdr *msglist;
- int msgsize; /* number of elements allocated in msglist[] */
- int msgused; /* number of elements used in msglist[] */
- int msgcurr; /* element in msglist[] being transmitted now */
- int msgbytes; /* number of bytes in current msg */
-
- /* data for UDP clients */
- int udp; /* is this is a UDP "connection" */
- int request_id; /* UDP request ID of current operation, if this is a UDP "connection" */
- uint8_t *hdrbuf; /* udp packet headers */
- int hdrsize; /* number of headers' worth of space is allocated */
- struct sockaddr srv_recv_addr; /* Sent the most recent request to which server */
- socklen_t srv_recv_addr_size;
-
- /* udp read buffer */
- char *rudpbuf; /* buffer to read commands into for udp */
- int rudpsize; /* total allocated size of rudpbuf */
- int rudpbytes; /* how much data, starting from rudpbuf */
-
- /* order udp packet */
- ms_udppkt_t *udppkt; /* the offset of udp packet in rudpbuf */
- int packets; /* number of total packets need to read */
- int recvpkt; /* number of received packets */
- int pktcurr; /* current packet in rudpbuf being ordered */
- int ordcurr; /* current ordered packet */
-
- ms_task_item_t *item_win; /* task sequence */
- int win_size; /* current task window size */
- uint64_t set_cursor; /* current set item index in the item window */
- ms_task_t curr_task; /* current running task */
- ms_mlget_task_t mlget_task; /* multi-get task */
-
- int warmup_num; /* to run how many warm up operations*/
- int remain_warmup_num; /* left how many warm up operations to run */
- int64_t exec_num; /* to run how many task operations */
- int64_t remain_exec_num; /* how many remained task operations to run */
-
- /* response time statistic and time out control */
- struct timeval start_time; /* start time of current operation(s) */
- struct timeval end_time; /* end time of current operation(s) */
-
- /* Binary protocol stuff */
- protocol_binary_response_header binary_header; /* local temporary binary header */
- enum protocol protocol; /* which protocol this connection speaks */
+typedef struct conn
+{
+ uint32_t conn_idx; /* connection index in the thread */
+ int sfd; /* current tcp sock handler of the connection structure */
+ int udpsfd; /* current udp sock handler of the connection structure*/
+ int state; /* state of the connection */
+ struct event event; /* event for libevent */
+ short ev_flags; /* event flag for libevent */
+ short which; /* which events were just triggered */
+ bool change_sfd; /* whether change sfd */
+
+ int *tcpsfd; /* TCP sock array */
+ uint32_t total_sfds; /* how many socks in the tcpsfd array */
+ uint32_t alive_sfds; /* alive socks */
+ uint32_t cur_idx; /* current sock index in tcpsfd array */
+
+ ms_cmdstat_t precmd; /* previous command state */
+ ms_cmdstat_t currcmd; /* current command state */
+
+ char *rbuf; /* buffer to read commands into */
+ char *rcurr; /* but if we parsed some already, this is where we stopped */
+ int rsize; /* total allocated size of rbuf */
+ int rbytes; /* how much data, starting from rcur, do we have unparsed */
+
+ bool readval; /* read value state, read known data size */
+ int rvbytes; /* total value size need to read */
+
+ char *wbuf; /* buffer to write commands out */
+ char *wcurr; /* for multi-get, where we stopped */
+ int wsize; /* total allocated size of wbuf */
+ bool ctnwrite; /* continue to write */
+
+ /* data for the mwrite state */
+ struct iovec *iov;
+ int iovsize; /* number of elements allocated in iov[] */
+ int iovused; /* number of elements used in iov[] */
+
+ struct msghdr *msglist;
+ int msgsize; /* number of elements allocated in msglist[] */
+ int msgused; /* number of elements used in msglist[] */
+ int msgcurr; /* element in msglist[] being transmitted now */
+ int msgbytes; /* number of bytes in current msg */
+
+ /* data for UDP clients */
+ bool udp; /* is this is a UDP "connection" */
+ uint32_t request_id; /* UDP request ID of current operation, if this is a UDP "connection" */
+ uint8_t *hdrbuf; /* udp packet headers */
+ int hdrsize; /* number of headers' worth of space is allocated */
+ struct sockaddr srv_recv_addr; /* Sent the most recent request to which server */
+ socklen_t srv_recv_addr_size;
+
+ /* udp read buffer */
+ char *rudpbuf; /* buffer to read commands into for udp */
+ int rudpsize; /* total allocated size of rudpbuf */
+ int rudpbytes; /* how much data, starting from rudpbuf */
+
+ /* order udp packet */
+ ms_udppkt_t *udppkt; /* the offset of udp packet in rudpbuf */
+ int packets; /* number of total packets need to read */
+ int recvpkt; /* number of received packets */
+ int pktcurr; /* current packet in rudpbuf being ordered */
+ int ordcurr; /* current ordered packet */
+
+ ms_task_item_t *item_win; /* task sequence */
+ int win_size; /* current task window size */
+ uint64_t set_cursor; /* current set item index in the item window */
+ ms_task_t curr_task; /* current running task */
+ ms_mlget_task_t mlget_task; /* multi-get task */
+
+ int warmup_num; /* to run how many warm up operations*/
+ int remain_warmup_num; /* left how many warm up operations to run */
+ int64_t exec_num; /* to run how many task operations */
+ int64_t remain_exec_num; /* how many remained task operations to run */
+
+ /* response time statistic and time out control */
+ struct timeval start_time; /* start time of current operation(s) */
+ struct timeval end_time; /* end time of current operation(s) */
+
+ /* Binary protocol stuff */
+ protocol_binary_response_header binary_header; /* local temporary binary header */
+ enum protocol protocol; /* which protocol this connection speaks */