From 6af040cf2949ce0eebe52121efef6bb3ce4bcc54 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 25 Nov 2017 12:50:02 +0000 Subject: [Fix] Do not try to connect to non-supported addresses --- contrib/hiredis/net.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'contrib') diff --git a/contrib/hiredis/net.c b/contrib/hiredis/net.c index e4aa920ad..6aada0a6f 100644 --- a/contrib/hiredis/net.c +++ b/contrib/hiredis/net.c @@ -310,6 +310,10 @@ static int _redisContextConnectTcp(redisContext *c, const char *addr, int port, memset(&hints,0,sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; + if (!blocking) { + /* Rspamd specific: never try to resolve on non-blocking conn requests */ + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV; + } /* Try with IPv6 if no IPv4 address was found. We do it in this order since * in a Redis client you can't afford to test if you have IPv6 connectivity -- cgit v1.2.3