From a3a963dc3dc49617d48c35127b29a17000ff25f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Feb 2015 21:26:34 +0000 Subject: Fix client socket address. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@5549 a436a847-0d15-0410-975c-d299462d15a1 --- raul/Socket.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'raul/Socket.hpp') diff --git a/raul/Socket.hpp b/raul/Socket.hpp index 6523ef1..e16b883 100644 --- a/raul/Socket.hpp +++ b/raul/Socket.hpp @@ -227,10 +227,13 @@ Socket::accept() } Raul::URI client_uri = _uri; - char host[NI_MAXHOST]; - if (getnameinfo(client_addr, client_addr_len, - host, sizeof(host), NULL, 0, 0)) { - client_uri = Raul::URI(_uri.scheme() + "://" + host); + if (_type != Type::UNIX) { + char host[NI_MAXHOST]; + char serv[NI_MAXSERV]; + if (!getnameinfo(client_addr, client_addr_len, + host, sizeof(host), serv, sizeof(serv), 0)) { + client_uri = Raul::URI(_uri.scheme() + "://" + host + ":" + serv); + } } return std::shared_ptr( -- cgit v1.2.1