mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-14 02:57:47 +01:00
Better handling of memory error in resolve_ip_hostname
Signed-off-by: Paul Colomiets <pc@gafol.net>
This commit is contained in:
parent
864c18f797
commit
38e5f8699c
@ -301,7 +301,16 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
|
||||
addrinfo *res;
|
||||
int rc = getaddrinfo (hostname.c_str (), service.c_str (), &req, &res);
|
||||
if (rc) {
|
||||
|
||||
switch (rc) {
|
||||
case EAI_MEMORY:
|
||||
errno = ENOMEM;
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ zmq::zmq_connecter_t::zmq_connecter_t (class io_thread_t *io_thread_,
|
||||
current_reconnect_ivl(options.reconnect_ivl)
|
||||
{
|
||||
int rc = tcp_connecter.set_address (protocol_, address_);
|
||||
zmq_assert (rc == 0);
|
||||
zmq_assert (rc == 0); //TODO: take care ENOMEM, EINVAL
|
||||
}
|
||||
|
||||
zmq::zmq_connecter_t::~zmq_connecter_t ()
|
||||
|
Loading…
Reference in New Issue
Block a user