mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
Fix some unitialized fields in client
struct (#1126)
This commit adds initialization code for the fields `io_last_reply_block` and `io_last_bufpos` of the `client` struct. While in the current code flow, these fields are only accessed after being written in the `trySendWriteToIOThreads`, I discovered that they were not being initialized while doing some changes to the code flow of IO threads. I believe it's good pratice to initialize all fields of a struct upon creation, and will avoid future bugs which are usually hard to debug. Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
This commit is contained in:
parent
dcac3e1499
commit
6a8540cefe
@ -232,6 +232,8 @@ client *createClient(connection *conn) {
|
||||
c->net_output_bytes = 0;
|
||||
c->net_output_bytes_curr_cmd = 0;
|
||||
c->commands_processed = 0;
|
||||
c->io_last_reply_block = NULL;
|
||||
c->io_last_bufpos = 0;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user