Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr
@ 2019-02-28 21:27 Vladislav Shpilevoy
  2019-02-28 21:58 ` [tarantool-patches] " Konstantin Osipov
  0 siblings, 1 reply; 3+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-28 21:27 UTC (permalink / raw)
  To: tarantool-patches; +Cc: vdavydov.dev

SWIM module API is going to provide a set of clear and pure
functions with appropriately settled const qualifiers. And it
wants to use sio_strfaddr() to provide to user an easy way to
get a pointer to URI of a SWIM member stored in a const memory.

It requires this two-line modification of sio module.
---
Branch: https://github.com/tarantool/tarantool/tree/gerold103/sio-const

 src/lib/core/sio.c | 2 +-
 src/lib/core/sio.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/core/sio.c b/src/lib/core/sio.c
index 7ea13f736..bb8e508d9 100644
--- a/src/lib/core/sio.c
+++ b/src/lib/core/sio.c
@@ -294,7 +294,7 @@ sio_getpeername(int fd, struct sockaddr *addr, socklen_t *addrlen)
 }
 
 const char *
-sio_strfaddr(struct sockaddr *addr, socklen_t addrlen)
+sio_strfaddr(const struct sockaddr *addr, socklen_t addrlen)
 {
 	static __thread char name[NI_MAXHOST + _POSIX_PATH_MAX + 2];
 	switch (addr->sa_family) {
diff --git a/src/lib/core/sio.h b/src/lib/core/sio.h
index 27988a232..19fbe0bb8 100644
--- a/src/lib/core/sio.h
+++ b/src/lib/core/sio.h
@@ -71,7 +71,7 @@ sio_wouldblock(int err)
  * May garble errno. Used for error reporting.
  */
 const char *
-sio_strfaddr(struct sockaddr *addr, socklen_t addrlen);
+sio_strfaddr(const struct sockaddr *addr, socklen_t addrlen);
 
 /**
  * Return a filled in struct sockaddr provided the file
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr
  2019-02-28 21:27 [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr Vladislav Shpilevoy
@ 2019-02-28 21:58 ` Konstantin Osipov
  2019-03-01  9:40   ` [tarantool-patches] " Vladislav Shpilevoy
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Osipov @ 2019-02-28 21:58 UTC (permalink / raw)
  To: tarantool-patches; +Cc: vdavydov.dev

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/03/01 00:29]:
> SWIM module API is going to provide a set of clear and pure
> functions with appropriately settled const qualifiers. And it
> wants to use sio_strfaddr() to provide to user an easy way to
> get a pointer to URI of a SWIM member stored in a const memory.

OK to push.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] Re: [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr
  2019-02-28 21:58 ` [tarantool-patches] " Konstantin Osipov
@ 2019-03-01  9:40   ` Vladislav Shpilevoy
  0 siblings, 0 replies; 3+ messages in thread
From: Vladislav Shpilevoy @ 2019-03-01  9:40 UTC (permalink / raw)
  To: tarantool-patches, Konstantin Osipov; +Cc: vdavydov.dev



On 01/03/2019 00:58, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/03/01 00:29]:
>> SWIM module API is going to provide a set of clear and pure
>> functions with appropriately settled const qualifiers. And it
>> wants to use sio_strfaddr() to provide to user an easy way to
>> get a pointer to URI of a SWIM member stored in a const memory.
> 
> OK to push.

Pushed to 2.1.

> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-01  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 21:27 [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr Vladislav Shpilevoy
2019-02-28 21:58 ` [tarantool-patches] " Konstantin Osipov
2019-03-01  9:40   ` [tarantool-patches] " Vladislav Shpilevoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox