]> granicus.if.org Git - icinga2/commitdiff
Implement UNIX domain socket support for the RedisWriter class
authorGunnar Beutner <gunnar.beutner@icinga.com>
Mon, 13 Feb 2017 08:33:26 +0000 (09:33 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Mon, 13 Feb 2017 13:21:13 +0000 (14:21 +0100)
refs #4991

lib/redis/rediswriter.cpp
lib/redis/rediswriter.ti

index 1c0691bb93096bb00184c248f8b5187bb5992807..a723fb226e006f24a1bef3d116576ca76e808080 100644 (file)
@@ -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();
 
index dc5863b7809ba3f04d04477b6f4659930a140fe3..964e08960ee2b5baeb8ffccb536f91e4c7e4566e 100644 (file)
@@ -32,6 +32,7 @@ class RedisWriter : ConfigObject
        [config] int port {
                default {{{ return 6379; }}}
        };
+       [config] String path;
        [config] String password;
 };