From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 CE596469719 for ; Tue, 3 Mar 2020 16:26:52 +0300 (MSK) Date: Tue, 3 Mar 2020 16:26:50 +0300 From: Sergey Ostanevich Message-ID: <20200303132650.GA188@tarantool.org> References: <20200221195140.GE68447@tarantool.org> <0eb599eb-153c-de4b-f184-7f6bdaebc95f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0eb599eb-153c-de4b-f184-7f6bdaebc95f@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/1] iproto: show real port in logs and box.info.listen List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Thanks, LGTM. The misunderstanding with protocol was my off-the-source fault. Sergos On 22 фев 16:00, Vladislav Shpilevoy wrote: > Hi! Thanks for the review! > > >> Box.cfg{listen = 0} automatically chooses a port. But it was > >> impossible to learn a real port the instance is bound to. > > ^^^^^ obtain? > > Done. > > >> diff --git a/src/box/iproto.cc b/src/box/iproto.cc > >> index 34c8f469a..522c066be 100644 > >> --- a/src/box/iproto.cc > >> +++ b/src/box/iproto.cc > >> @@ -129,6 +129,23 @@ unsigned iproto_readahead = 16320; > >> /* The maximal number of iproto messages in fly. */ > >> static int iproto_msg_max = IPROTO_MSG_MAX_MIN; > >> > >> +/** > >> + * Address the iproto listens for, stored in TX > >> + * thread. Is kept in TX to be showed in box.info. > > shown, since V3? > > Done. > > >> + */ > >> +static struct sockaddr_storage iproto_bound_address_storage; > >> +/** 0 means that no address is listened. */ > >> +static socklen_t iproto_bound_address_len; > >> + > >> +const char * > >> +iproto_bound_address(void) > >> +{ > >> + if (iproto_bound_address_len == 0) > >> + return NULL; > >> + return sio_strfaddr((struct sockaddr *) &iproto_bound_address_storage, > >> + iproto_bound_address_len); > >> +} > >> diff --git a/src/box/iproto.h b/src/box/iproto.h > >> index edb24a7ed..201e09df5 100644 > >> --- a/src/box/iproto.h > >> +++ b/src/box/iproto.h > >> @@ -80,6 +80,13 @@ iproto_request_count(void); > >> void > >> iproto_reset_stat(void); > >> > >> +/** > >> + * String representation of the address served by > >> + * iproto. To be showed in box.info. > > shown > > Done.