mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 08:13:14 +02:00
Merge remote-tracking branch 'origin/pr/771'
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <resolv.h>
|
||||
#include <errno.h>
|
||||
#include <gcrypt.h>
|
||||
#include <sys/time.h>
|
||||
@@ -311,6 +312,9 @@ network_resolve (const char *hostname, char *ip, int *version)
|
||||
|
||||
res = NULL;
|
||||
|
||||
if (res_init() != 0)
|
||||
return 0;
|
||||
|
||||
if (getaddrinfo (hostname, NULL, NULL, &res) != 0)
|
||||
return 0;
|
||||
|
||||
@@ -696,6 +700,8 @@ 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;
|
||||
if (getaddrinfo (CONFIG_STRING(ptr_proxy->options[PROXY_OPTION_ADDRESS]),
|
||||
str_port, &hints, &proxy_addrinfo) != 0)
|
||||
{
|
||||
@@ -806,7 +812,8 @@ network_connect_child (struct t_hook *hook_connect)
|
||||
#ifdef AI_ADDRCONFIG
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
#endif /* AI_ADDRCONFIG */
|
||||
if (ptr_proxy)
|
||||
rc = res_init();
|
||||
if (!rc && ptr_proxy)
|
||||
{
|
||||
hints.ai_family = (CONFIG_BOOLEAN(ptr_proxy->options[PROXY_OPTION_IPV6])) ?
|
||||
AF_UNSPEC : AF_INET;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#endif /* _WIN32 */
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#include <resolv.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
@@ -5132,7 +5133,8 @@ irc_server_xfer_send_ready_cb (const void *pointer, void *data,
|
||||
"local_address");
|
||||
if (local_address)
|
||||
{
|
||||
rc = getaddrinfo (local_address, NULL, NULL, &ainfo);
|
||||
if ((rc = res_init()) == 0)
|
||||
rc = getaddrinfo (local_address, NULL, NULL, &ainfo);
|
||||
if ((rc == 0) && ainfo && ainfo->ai_addr)
|
||||
{
|
||||
if (ainfo->ai_family == AF_INET)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <resolv.h>
|
||||
#include <gcrypt.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@@ -966,6 +967,8 @@ 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;
|
||||
rc = getaddrinfo (str_address, str_port, &hints, &ainfo);
|
||||
if ((rc == 0) && ainfo && ainfo->ai_addr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user