From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (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 EEE88469719 for ; Sat, 22 Feb 2020 18:00:57 +0300 (MSK) References: <20200221195140.GE68447@tarantool.org> From: Vladislav Shpilevoy Message-ID: <0eb599eb-153c-de4b-f184-7f6bdaebc95f@tarantool.org> Date: Sat, 22 Feb 2020 16:00:49 +0100 MIME-Version: 1.0 In-Reply-To: <20200221195140.GE68447@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org 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.