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 9D7206EC58; Wed, 4 Aug 2021 02:08:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9D7206EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628032108; bh=iIb1nOvjIaIBk18ze9NacbdZvvDjl2BTN8rTxKo1eH8=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wreB+WqoofM7IoN8WFrIvu20SNlOYIINRwg3WGQfkmHXk+k74wYykErTMqqW5Jz1c wGKQJZ5VqsUfNAMdrZ8Jz9xzn3xDJQAtEoUlylzcySM1kJ1AFQYfXN93nBYQjinlao zSxdA7DbQ+TMPKm+EVp1E9BrOVf6yhXX9GZT0IhI= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 667486EC58 for ; Wed, 4 Aug 2021 02:08:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 667486EC58 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mB3WM-0002tS-MP; Wed, 04 Aug 2021 02:08:27 +0300 To: Vladimir Davydov , tarantool-patches@dev.tarantool.org References: <21b94b5bea3b00bde3e866300992fbff78a76b5c.1627024646.git.vdavydov@tarantool.org> Message-ID: <1683388e-d329-947e-633a-ded9a123a923@tarantool.org> Date: Wed, 4 Aug 2021 01:08:25 +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: <21b94b5bea3b00bde3e866300992fbff78a76b5c.1627024646.git.vdavydov@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C351B198F4576AC7B20CA14D9DFB46B94A182A05F5380850407245F896C3D72FEAD6341D41A98675731B5CC74DDB41DB213B2BB46BB1A3DB15 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77E216A0E97507353EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748C26B83F2B024408638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C0A9F990F84223AE6A747E9B5A16BDC8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5558C408CF368569DA497FD0180BE79FF3537F4986302D9CDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA751B940EDA0DFB0535410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A246DFF68F0EE19E03E1B3B5F2121981AB69AA92EF156CCF4F0BD041872FE3944C8395C92A43C3F91D7E09C32AA3244C66DF778DB25756B1D0A0F0B42EA8BEAD51E887DA02A9F7BF729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojeDyvyeZJDJFhrX3rsLgQ5A== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DB0C3A2980B1F2BC554D7776DC1E8126D3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 18/20] net.box: rewrite iproto handlers 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the patch! > diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c > index 85a45c54b979..fde2a8772890 100644 > --- a/src/box/lua/net_box.c > +++ b/src/box/lua/net_box.c > @@ -1800,6 +1759,188 @@ netbox_dispatch_response_console(struct lua_State *L, > netbox_request_complete(request); > } > > +/* > + * Performs an authorization request for an iproto connection. > + * Takes user, password, salt, request registry, socket fd, > + * send_buf (ibuf), recv_buf (ibuf), timeout. > + * Returns schema_version on success, nil and error on failure. > + */ > +static int > +netbox_iproto_auth(struct lua_State *L) > +{ > + size_t user_len; > + const char *user = lua_tolstring(L, 1, &user_len); > + size_t password_len; > + const char *password = lua_tolstring(L, 2, &password_len); > + size_t salt_len; > + const char *salt = lua_tolstring(L, 3, &salt_len); > + if (salt_len < SCRAMBLE_SIZE) > + return luaL_error(L, "Invalid salt"); > + struct netbox_registry *registry = luaT_check_netbox_registry(L, 4); > + int fd = lua_tointeger(L, 5); > + struct ibuf *send_buf = (struct ibuf *) lua_topointer(L, 6); > + struct ibuf *recv_buf = (struct ibuf *) lua_topointer(L, 7); > + double timeout = (!lua_isnoneornil(L, 8) ? > + lua_tonumber(L, 8) : TIMEOUT_INFINITY); Timeout is never passed, it is always TIMEOUT_INFINITY. The same in netbox_iproto_schema and netbox_iproto_loop.