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 F1ADB6EC6E; Fri, 23 Jul 2021 14:10:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F1ADB6EC6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627038634; bh=BDMw2xdKMnZYsIYcYfOW57ALHRtdMrN7lcXbNhYW5F0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HiEXkR+ZDMrhVR3M+y8Z48v1dzdSsSx5i1/PPhxNeOL/+ZW6wJtEzbBtziw4V+GXR ranH1oPJ5yDP5eFNWCQwcYeJA8bjwd6aIQxedMxTowahT9ESmG4zB3/l5BrfyXadck cXI2OpnZNnhnvRAi/vmfqIhMa3sYBLKNdZbgJNlw= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 3F7246EC7F for ; Fri, 23 Jul 2021 14:07:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3F7246EC7F Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1m6t1i-0004dl-NP; Fri, 23 Jul 2021 14:07:35 +0300 To: tarantool-patches@dev.tarantool.org Date: Fri, 23 Jul 2021 14:07:16 +0300 Message-Id: <83ad38fd1425a056ea71daab77e1dde18087aed0.1627024646.git.vdavydov@tarantool.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-174C08C4: 5188C02AEC42908C481ED7ADC579193296BBA28369E3F2D2713F3D5F7D406D31BCF678C7329BA986 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C36A98DBA789EBB6AEFB5A483DCE5E7579182A05F538085040CCAA1E0EB08DCCEC3B6B2596139F1B3794E67BB6024CE557F1690EDA16D5542B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB84ED444C624799EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373BFF7CCD9F2968778638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D81FE09DA5E4010DF538C9A8DBEA0B0548117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC47272755C61AA17BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9149C560DC76099D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 8BD88D57C5CADBC8B2710865C3867510A0B4543D0F65078DA3B1A56EE2B804F6B226C914C996894645FD9D8A29397D6EFF55FE49A3C2BFCFC8C84E951CD0BE2F296C473AB1E14218EA052B563B0B06C67866D6147AF826D81FE09DA5E4010DF538C9A8DBEA0B0548F972CCD2F8FE1EF1CFC4036BBF6A4EA9C7D5A5BACB49E656CB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D6AC337C1E637B8A8DD8A6F6C63E4C18B58AD309B33A6E4E5ED8B4CE1EBF3B12AFDFA18D3AED934F1D7E09C32AA3244C286E747F9F484DF7EEB085EEA8570FA751E887DA02A9F7BF729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXiEX0g4jkpDtdM6NfnqPwRt X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D533108D2F0B49B124B6792227EF92F47274CEFED1673C562683ABF942079399BFB559BB5D741EB966A65DFF43FF7BE03240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: [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: Vladimir Davydov via Tarantool-patches Reply-To: Vladimir Davydov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Request context only stores tuple format or nil, which is used for decoding a response. Rename it appropriately. --- src/box/lua/net_box.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua index 40bbf993a49a..0ac0c0375a45 100644 --- a/src/box/lua/net_box.lua +++ b/src/box/lua/net_box.lua @@ -523,7 +523,7 @@ local function create_transport(host, port, user, password, callback, -- @retval not nil Future object. -- local function perform_async_request(buffer, skip_header, method, on_push, - on_push_ctx, request_ctx, ...) + on_push_ctx, format, ...) if state ~= 'active' and state ~= 'fetch_schema' then local code = last_errno or E_NO_CONNECTION local msg = last_error or @@ -541,7 +541,7 @@ local function create_transport(host, port, user, password, callback, next_request_id = next_id(id) -- Request in most cases has maximum 10 members: -- method, buffer, skip_header, id, cond, errno, response, - -- on_push, on_push_ctx and ctx. + -- on_push, on_push_ctx and format. local request = setmetatable(table_new(0, 10), request_mt) request.method = method request.buffer = buffer @@ -551,7 +551,7 @@ local function create_transport(host, port, user, password, callback, requests[id] = request request.on_push = on_push request.on_push_ctx = on_push_ctx - request.ctx = request_ctx + request.format = format return request end @@ -561,10 +561,10 @@ local function create_transport(host, port, user, password, callback, -- @retval not nil Response object. -- local function perform_request(timeout, buffer, skip_header, method, - on_push, on_push_ctx, request_ctx, ...) + on_push, on_push_ctx, format, ...) local request, err = perform_async_request(buffer, skip_header, method, on_push, - on_push_ctx, request_ctx, ...) + on_push_ctx, format, ...) if not request then return nil, err end @@ -648,7 +648,8 @@ local function create_transport(host, port, user, password, callback, -- Decode xrow.body[DATA] to Lua objects if status == IPROTO_OK_KEY then request.response, real_end = - method_decoder[request.method](body_rpos, body_end, request.ctx) + method_decoder[request.method](body_rpos, body_end, + request.format) assert(real_end == body_end, "invalid body length") requests[id] = nil request.id = nil @@ -1148,7 +1149,7 @@ function remote_methods:wait_connected(timeout) return self._transport.wait_state('active', timeout) end -function remote_methods:_request(method, opts, request_ctx, ...) +function remote_methods:_request(method, opts, format, ...) local transport = self._transport local on_push, on_push_ctx, buffer, skip_header, deadline -- Extract options, set defaults, check if the request is @@ -1162,7 +1163,7 @@ function remote_methods:_request(method, opts, request_ctx, ...) end local res, err = transport.perform_async_request(buffer, skip_header, method, - table.insert, {}, request_ctx, + table.insert, {}, format, ...) if err then box.error(err) @@ -1191,7 +1192,7 @@ function remote_methods:_request(method, opts, request_ctx, ...) end local res, err = transport.perform_request(timeout, buffer, skip_header, method, on_push, on_push_ctx, - request_ctx, ...) + format, ...) if err then box.error(err) end -- 2.25.1