problem:Fallback to localhost in ws_address has no effect

Solution: return after the fallback

fixes #3809
This commit is contained in:
Doron Somech 2020-02-06 09:18:23 +02:00
parent 7bfd9512e6
commit 071ec1a9bb

View File

@ -72,8 +72,10 @@ zmq::ws_address_t::ws_address_t (const sockaddr *sa_, socklen_t sa_len_)
char hbuf[NI_MAXHOST];
const int rc = getnameinfo (addr (), addrlen (), hbuf, sizeof (hbuf), NULL,
0, NI_NUMERICHOST);
if (rc != 0)
if (rc != 0) {
_host = std::string ("localhost");
return;
}
std::ostringstream os;