projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e30731
)
Add support for unix socket connection to redis (#5179)
author
Travis Burtrum
<android@moparisthebest.org>
Mon, 6 Feb 2017 18:10:03 +0000
(13:10 -0500)
committer
Loïc Blot
<nerzhul@users.noreply.github.com>
Mon, 6 Feb 2017 18:10:03 +0000
(19:10 +0100)
src/database-redis.cpp
patch
|
blob
|
history
diff --git
a/src/database-redis.cpp
b/src/database-redis.cpp
index 3bcedad9bfdaddc71b50e753570164b2ab66d5b4..3df186944ea1697b974e492f057ccc237d345da6 100644
(file)
--- a/
src/database-redis.cpp
+++ b/
src/database-redis.cpp
@@
-44,7
+44,8
@@
Database_Redis::Database_Redis(Settings &conf)
}
const char *addr = tmp.c_str();
int port = conf.exists("redis_port") ? conf.getU16("redis_port") : 6379;
- ctx = redisConnect(addr, port);
+ // if redis_address contains '/' assume unix socket, else hostname/ip
+ ctx = tmp.find('/') != std::string::npos ? redisConnectUnix(addr) : redisConnect(addr, port);
if (!ctx) {
throw DatabaseException("Cannot allocate redis context");
} else if (ctx->err) {