mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
core: irc, xfer: do not check return code of res_init()
If the call to res_init() fails, the connection may be OK anyway or in worst case it will fail (with an appropriate error) if the name can not be resolved.
This commit is contained in:
@@ -313,8 +313,7 @@ network_resolve (const char *hostname, char *ip, int *version)
|
||||
|
||||
res = NULL;
|
||||
|
||||
if (res_init() != 0)
|
||||
return 0;
|
||||
res_init ();
|
||||
|
||||
if (getaddrinfo (hostname, NULL, NULL, &res) != 0)
|
||||
return 0;
|
||||
@@ -701,8 +700,7 @@ network_connect_to (const char *proxy, struct sockaddr *address,
|
||||
hints.ai_flags = AI_NUMERICSERV;
|
||||
snprintf (str_port, sizeof (str_port), "%d",
|
||||
CONFIG_INTEGER(ptr_proxy->options[PROXY_OPTION_PORT]));
|
||||
if (res_init() != 0)
|
||||
goto error;
|
||||
res_init ();
|
||||
if (getaddrinfo (CONFIG_STRING(ptr_proxy->options[PROXY_OPTION_ADDRESS]),
|
||||
str_port, &hints, &proxy_addrinfo) != 0)
|
||||
{
|
||||
@@ -813,8 +811,8 @@ network_connect_child (struct t_hook *hook_connect)
|
||||
#ifdef AI_ADDRCONFIG
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
#endif /* AI_ADDRCONFIG */
|
||||
rc = res_init();
|
||||
if (!rc && ptr_proxy)
|
||||
res_init ();
|
||||
if (ptr_proxy)
|
||||
{
|
||||
hints.ai_family = (CONFIG_BOOLEAN(ptr_proxy->options[PROXY_OPTION_IPV6])) ?
|
||||
AF_UNSPEC : AF_INET;
|
||||
|
||||
@@ -5134,8 +5134,8 @@ irc_server_xfer_send_ready_cb (const void *pointer, void *data,
|
||||
"local_address");
|
||||
if (local_address)
|
||||
{
|
||||
if ((rc = res_init()) == 0)
|
||||
rc = getaddrinfo (local_address, NULL, NULL, &ainfo);
|
||||
res_init ();
|
||||
rc = getaddrinfo (local_address, NULL, NULL, &ainfo);
|
||||
if ((rc == 0) && ainfo && ainfo->ai_addr)
|
||||
{
|
||||
if (ainfo->ai_family == AF_INET)
|
||||
|
||||
@@ -968,8 +968,7 @@ xfer_resolve_addr (const char *str_address, const char *str_port,
|
||||
hints.ai_addr = NULL;
|
||||
hints.ai_next = NULL;
|
||||
|
||||
if (res_init() != 0)
|
||||
return 0;
|
||||
res_init ();
|
||||
rc = getaddrinfo (str_address, str_port, &hints, &ainfo);
|
||||
if ((rc == 0) && ainfo && ainfo->ai_addr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user