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 BDEDD6EC58; Mon, 2 Aug 2021 11:00:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BDEDD6EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627891224; bh=lHL+ImRFwJCIjQV+YrBJz/DY/Xk802T93vstqJGVjOM=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=lxYre06pQxhQNxSzd49xwPLXCamSEbROma7xtBG4JZKve5xCrbJIFwe+Anbd7QTcg Yp0aIRtYIpCMnSwZdkA2YwWRa9huBilm9/rc/iAPWw1c6oABdiOV20lBC0sJR9zXtZ Igzzxos0z5SxFgE5i0Eq35MNJVLOIToekZptK3C8= 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 E6A476EC58 for ; Mon, 2 Aug 2021 11:00:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E6A476EC58 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mASs3-00026h-7D; Mon, 02 Aug 2021 11:00:23 +0300 Date: Mon, 2 Aug 2021 11:00:22 +0300 To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Message-ID: <20210802080022.lw2pjqjoiitliqmf@esperanza> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C351B198F4576AC7B20CA14D9DFB46B94A182A05F538085040E5A5BCB7E1B1A058ADE3957DE8D2FA0FD004ABE02DDE86C1FBC8AA4A62828B32 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE789066434B85BF7C7EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F91103FA893F53AB8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E0EBD8C0BD8FC2BBD62AE1161F5D0032117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A1DCCEB63E2F10FB089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5678C5CC73E91B1319BA83F8DB7993C4414CD3F1BC1AAC374D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA751B940EDA0DFB0535410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343536C6A4332D8B8AD6E053D0F625E184977C4E0B47E6A20C7024CE7CA4645E0C91DAC159AF7B29E21D7E09C32AA3244C4D550FE1C10999791537448438483F0C725D5B54B2FE4575FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMCfuYI4PrecuH249jzDawQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DD1C69F45A74F710F2ACFF94F55575147274CEFED1673C562683ABF942079399BFB559BB5D741EB966A65DFF43FF7BE03240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 12/20] net.box: rewrite error decoder in C 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" On Sat, Jul 31, 2021 at 12:13:15AM +0200, Vladislav Shpilevoy wrote: > > + mp_next(data); /* skip value */ > > 1. Could you please write comments on their own lines if possible? Done. > > -ffi.cdef[[ > > -struct error * > > -error_unpack_unsafe(const char **data); > > 2. You should be able to remove it from exports.h now. It > is not used by FFI anymore. (error_unref() should stay in > export.h - it is used by error Lua module.) Done. > > -local response_decoder = { > > - [IPROTO_ERROR_24] = decode, > > - [IPROTO_ERROR] = decode_error, > > 3. IPROTO_ERROR is now unused. Removed. Pushed all the changes to the branch and rebased. The incremental diff is below: -- diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c index 0914697f2b2e..e1f820926838 100644 --- a/src/box/lua/net_box.c +++ b/src/box/lua/net_box.c @@ -1051,7 +1051,7 @@ netbox_decode_method(struct lua_State *L) return 2; } -/* +/** * Decodes an error from raw data and pushes it to Lua stack. Takes a pointer * to the data (char ptr) and an error code. */ @@ -1092,7 +1092,8 @@ netbox_decode_error(struct lua_State *L) error_ref(error); continue; } - mp_next(data); /* skip value */ + /* Skip value. */ + mp_next(data); } if (error == NULL) { /* diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua index c0c3c4098525..242b1c8d9314 100644 --- a/src/box/lua/net_box.lua +++ b/src/box/lua/net_box.lua @@ -41,7 +41,6 @@ local IPROTO_SYNC_KEY = 0x01 local IPROTO_SCHEMA_VERSION_KEY = 0x05 local IPROTO_DATA_KEY = 0x30 local IPROTO_ERROR_24 = 0x31 -local IPROTO_ERROR = 0x52 local IPROTO_GREETING_SIZE = 128 local IPROTO_CHUNK_KEY = 128 local IPROTO_OK_KEY = 0 diff --git a/src/exports.h b/src/exports.h index 5bb3e6a2b55a..7be6486f0075 100644 --- a/src/exports.h +++ b/src/exports.h @@ -220,7 +220,6 @@ EXPORT(curl_version_info) EXPORT(decimal_unpack) EXPORT(error_ref) EXPORT(error_set_prev) -EXPORT(error_unpack_unsafe) EXPORT(error_unref) EXPORT(exception_get_int) EXPORT(exception_get_string)