From: Ilya Kosarev <i.kosarev@tarantool.org>
To: v.shpilevoy@tarantool.org, alyapunov@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v6 1/3] iproto: move msg fields initialization to iproto_msg_new()
Date: Sun, 13 Dec 2020 02:38:45 +0300 [thread overview]
Message-ID: <e8c26b81b945ea69826bca84e46c41170561a9b5.1607815050.git.i.kosarev@tarantool.org> (raw)
In-Reply-To: <cover.1607815050.git.i.kosarev@tarantool.org>
In-Reply-To: <cover.1607815050.git.i.kosarev@tarantool.org>
msg->close_connection flag was only initialized in iproto_on_accept()
while other struct iproto_msg fields are being initialized in
iproto_msg_new(). It is potentially dangerous for new logic involving
msg->close_connection flag, so it is now moved to iproto_msg_new().
Part of #3776
---
src/box/iproto.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/box/iproto.cc b/src/box/iproto.cc
index b8f65e5eca..6a1e509225 100644
--- a/src/box/iproto.cc
+++ b/src/box/iproto.cc
@@ -565,6 +565,7 @@ iproto_msg_new(struct iproto_connection *con)
"connection %s", sio_socketname(con->input.fd));
return NULL;
}
+ msg->close_connection = false;
msg->connection = con;
rmean_collect(rmean_net, IPROTO_REQUESTS, 1);
return msg;
@@ -2040,7 +2041,6 @@ iproto_on_accept(struct evio_service * /* service */, int fd,
cmsg_init(&msg->base, connect_route);
msg->p_ibuf = con->p_ibuf;
msg->wpos = con->wpos;
- msg->close_connection = false;
cpipe_push(&tx_pipe, &msg->base);
return 0;
}
--
2.17.1
next prev parent reply other threads:[~2020-12-12 23:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 23:38 [Tarantool-patches] [PATCH v6 0/3] iproto: greeting enhancement Ilya Kosarev
2020-12-12 23:38 ` Ilya Kosarev [this message]
2020-12-12 23:38 ` [Tarantool-patches] [PATCH v6 2/3] iproto: fix comment and add assert on destruction Ilya Kosarev
2020-12-12 23:38 ` [Tarantool-patches] [PATCH v6 3/3] iproto: move greeting from tx thread to iproto Ilya Kosarev
2020-12-15 23:04 ` Vladislav Shpilevoy
2020-12-19 17:41 ` Ilya Kosarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e8c26b81b945ea69826bca84e46c41170561a9b5.1607815050.git.i.kosarev@tarantool.org \
--to=i.kosarev@tarantool.org \
--cc=alyapunov@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v6 1/3] iproto: move msg fields initialization to iproto_msg_new()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox