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 6E0366FC8F; Tue, 23 Mar 2021 01:32:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6E0366FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616452338; bh=euoL+iZo3h/TqnU1GLBruj9nQyOXWqiOo58JZtARae0=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SXaAGUWZPQX0rPRhgl1FbfbGwn0/1emT9yYFwhRA1J1t1AFYeHfjO4JxrzAFPgWRp nJvCM1wHN2MfaBynyryzkv4+afdTJgGd/2zKpG01ZinPGLL+3rkfROcajNBkM2gsaK 3Tuz4+kFrnYYMDLXbPhK5kNTa1tFJCpOAL9rpu/Y= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [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 947746FC8F for ; Tue, 23 Mar 2021 01:32:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 947746FC8F Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lOT5r-0002Nw-Rr; Tue, 23 Mar 2021 01:32:16 +0300 To: Cyrill Gorcunov References: <9ab1c358c2fda852d7f241dc7ccd3ca4381017bd.1616200860.git.v.shpilevoy@tarantool.org> Message-ID: Date: Mon, 22 Mar 2021 23:32:14 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F111116110879554077ED795A4341E98F3182A05F5380850404F46EDB3811962FF77A7B24DC03F24B4E2E6047D8080E51EC6520604703DFCD3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE741DC22BF90A736D8EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371E8C7BD479B346ED8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75E9CEF05FE95F409E2150E66B21225C278A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E14AD6D5ED66289B52BA9C0B312567BB23089D37D7C0E48F6CA18204E546F3947C83C798A30B85E16B42539A7722CA490CC8A9BA7A39EFB7666BA297DBC24807EA089D37D7C0E48F6C8AA50765F790063710A74FE5B09D3CF8731C566533BA786A40A5AABA2AD371193C9F3DD0FB1AF5EB39B26F9A09A85A293C9F3DD0FB1AF5EB4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20B386D740E071D760D96DB35A8F86FFD96 X-C1DE0DAB: 0D63561A33F958A50FFEA34831B7673337DCAA05FA7AEDE5DCF80F390974A038D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348F9E8EBB462314876026DCAE9BDD8F0BB2608F0679FAA70A3DBEDA8176ECADFCDCB61BF75C061C8F1D7E09C32AA3244CB3112A7EA4F51966A28E343C936F93E43A76366E8A9DE7CAFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6Uj0Ui550On52g== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822B4F4A8E5A057F9C6F325DD0534975DBF3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 14/16] sio: increase SERVICE_NAME_MAXLEN size 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the review! On 21.03.2021 22:58, Cyrill Gorcunov wrote: > On Sat, Mar 20, 2021 at 01:42:36AM +0100, Vladislav Shpilevoy wrote: >> >> -enum { SERVICE_NAME_MAXLEN = 32 }; >> +enum { >> + /** >> + * - Unix socket path is 108 bytes max; >> + * - IP(v4, v6) max string len is 45; > > Actually IPv6 may include a scope as well. Currently at least > libc indeed does limit it to 45 symbols plus eos mark so we're > safe. Still 200 seems to be much over the top, maybe 128 instead? I decided to be paranoid and made it 200 deliberately. Anyway it is not used in any swarm allocations. 128 seems right on the edge. You can have 108 bytes of Unix socket path, + strlen("unix/:"). It is already 114. Also it is used for sio_socketname(), where you have addr str (114) + strlen(", aka ")(6) + strlen(", peer of ")(10), which is already 130 total. > Also pow2 gonna be easier to manage by any memory manager. It would matter if the buffer would be ever allocated on its own. But it is always either on the stack, or inside of another structure, where total size is not a power of 2 anyway, most likely. > I don't insist though just a thought and this could be tuned up > on top.