From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 1F4F46EC55; Fri, 30 Jul 2021 01:39:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1F4F46EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627598397; bh=f84zeh0pM4R/CYbSO831wtlQITsrjFYqmDXahODqAZc=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=V7+eQK8fkjOJ+kerLLwLDW4rDW1rMJYxjTkJEHkFnfaT0ZFhtIXPhz6Dsxr2p0ahl prU82Zt9Numz4tgliUqrilDmVtwiaTFfNu8mNzt0EtA9KcxjgsEKhwEckGpd5yLe3X YBfGXTgvaQ55aJ+La4AK16LhpXmkPWWfzXmsVUgs= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 561736EC5C for ; Fri, 30 Jul 2021 01:39:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 561736EC5C Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1m9Egc-0006vS-GN; Fri, 30 Jul 2021 01:39:30 +0300 To: Vladimir Davydov Cc: tarantool-patches@dev.tarantool.org References: <83ad38fd1425a056ea71daab77e1dde18087aed0.1627024646.git.vdavydov@tarantool.org> <20210729105459.g3ixkeh4gqpvt2ig@esperanza> Message-ID: Date: Fri, 30 Jul 2021 00:39:29 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210729105459.g3ixkeh4gqpvt2ig@esperanza> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C3104FC76DFAAAAF7DA068FE323FAC4379182A05F53808504032A88F3B93CF1437F770FD76A25C927F6CAB1B9815E8AC32B209035CA6085294 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E9A0F80F179600C6EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DD81BB19E5DE3F6B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8A51650F3D23686FE316697DDACD0A71D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC47272755C61AA17BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A45692FFBBD75A6A089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5FA75A45E4BB9782B9CDD1FB5AC1BFA5F9A87C0197EFD833FD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753530422897FB34C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F1257DC9690AEBA1AA317E37CF0B8ECFE176A813E6FEF80D21AF223CAD700F02D5D292035CEEC5621D7E09C32AA3244C39624E59FF97D68EA3F12DEE8A1BA71269B6CAE0477E908D729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPp/mPgZxawGUuuqc6i6fFQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D5110BA32A85EFC0A83238D63A0E881993841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 06/20] net.box: rename request.ctx to request.format X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 29.07.2021 12:54, Vladimir Davydov wrote: > On Thu, Jul 29, 2021 at 12:49:39AM +0200, Vladislav Shpilevoy wrote: >> On 23.07.2021 13:07, Vladimir Davydov via Tarantool-patches wrote: >>> Request context only stores tuple format or nil, which is used for >>> decoding a response. Rename it appropriately. >> >> The name ctx was chosen intentionally, because when you pass it to >> method_decoder[request.method](...), you don't know how will it be >> used and what is stores. It was internal for the request sender and >> codec. Why do you need to change it? > > For one thing, it's always either nil or format. Naming it ctx is > confusing. > > The reason I'm doing this in the scope of this series is that it is > stored in the request class. Lua isn't a strictly typed language so we > can store whatever we want there, but in C we need to know the type to > define the request struct, see netbox_request::format here: > > https://github.com/tarantool/tarantool/blob/73cab8402f7e098c8e908af9a2b72695c754c472/src/box/lua/net_box.c#L99 > > Turning ctx to format solves this problem. You could store it as `void *` then. It just looks ugly, for instance, when you pass `struct tuple_format` into netbox_decode_nil(). Not all responses consist of tuples or even have a body. Up to you. We could change it in the future if need.