From 8ad567ce9971b0bf6f48dbcb81bd0ce55d85e2c3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 13 Feb 2017 09:33:26 +0100 Subject: [PATCH] Implement UNIX domain socket support for the RedisWriter class refs #4991 --- lib/redis/rediswriter.cpp | 6 +++++- lib/redis/rediswriter.ti | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/redis/rediswriter.cpp b/lib/redis/rediswriter.cpp index 1c0691bb9..a723fb226 100644 --- a/lib/redis/rediswriter.cpp +++ b/lib/redis/rediswriter.cpp @@ -36,9 +36,13 @@ void RedisWriter::Start(bool runtimeCreated) boost::thread thread(boost::bind(&RedisWriter::HandleEvents, this)); thread.detach(); + String path = GetPath(); String host = GetHost(); - m_Context = redisConnect(host.CStr(), GetPort()); + if (path.IsEmpty()) + m_Context = redisConnect(host.CStr(), GetPort()); + else + m_Context = redisConnectUnix(path.CStr()); String password = GetPassword(); diff --git a/lib/redis/rediswriter.ti b/lib/redis/rediswriter.ti index dc5863b78..964e08960 100644 --- a/lib/redis/rediswriter.ti +++ b/lib/redis/rediswriter.ti @@ -32,6 +32,7 @@ class RedisWriter : ConfigObject [config] int port { default {{{ return 6379; }}} }; + [config] String path; [config] String password; };