aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-30 12:46:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-30 12:46:28 +0000
commit3e8d0156b8549c38be5c934686c86e9133420e3a (patch)
treed67f5be007620954da2118fd2dbd13c58edbe5bf
parent6749a12babb0f27eb18a773aebab429387a20721 (diff)
downloadrspamd-3e8d0156b8549c38be5c934686c86e9133420e3a.tar.gz
rspamd-3e8d0156b8549c38be5c934686c86e9133420e3a.zip
[Fix] Support unix sockets for lua redis
Issue: #1277 Reported by: @athanp
-rw-r--r--src/libserver/redis_pool.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c
index 17fa22b1e..2cf4b5961 100644
--- a/src/libserver/redis_pool.c
+++ b/src/libserver/redis_pool.c
@@ -231,7 +231,12 @@ rspamd_redis_pool_new_connection (struct rspamd_redis_pool *pool,
struct rspamd_redis_pool_connection *conn;
struct redisAsyncContext *ctx;
- ctx = redisAsyncConnect (ip, port);
+ if (*ip == '/' || *ip == '.') {
+ ctx = redisAsyncConnectUnix (ip);
+ }
+ else {
+ ctx = redisAsyncConnect (ip, port);
+ }
if (ctx) {