From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id DB3C14765E0 for ; Thu, 24 Dec 2020 23:13:07 +0300 (MSK) From: Ilya Kosarev Date: Thu, 24 Dec 2020 23:13:01 +0300 Message-Id: <573f393a232efafe68a9b7fb9d58a6a62231c05f.1608840673.git.i.kosarev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH v9 1/3] iproto: move msg fields initialization to iproto_msg_new() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, alyapunov@tarantool.org Cc: tarantool-patches@dev.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 b8f65e5ec..6a1e50922 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