From: Joel Rosdahl Date: Fri, 13 May 2022 18:46:20 +0000 (+0200) Subject: fix: Support Redis URL without host X-Git-Tag: v4.6.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9f607b70d4c4c79fa9a9d6f11e433ba29f6ce5d;p=thirdparty%2Fccache.git fix: Support Redis URL without host --- diff --git a/src/storage/secondary/RedisStorage.cpp b/src/storage/secondary/RedisStorage.cpp index a607d229d..32bc4ae39 100644 --- a/src/storage/secondary/RedisStorage.cpp +++ b/src/storage/secondary/RedisStorage.cpp @@ -230,11 +230,11 @@ RedisStorageBackend::connect(const Url& url, ASSERT(url.path().empty() || url.path()[0] == '/'); LOG("Redis connecting to {}:{} (connect timeout {} ms)", - url.host(), + host, port, connect_timeout); - m_context.reset(redisConnectWithTimeout( - url.host().c_str(), port, to_timeval(connect_timeout))); + m_context.reset( + redisConnectWithTimeout(host.c_str(), port, to_timeval(connect_timeout))); if (!m_context) { throw Failed("Redis context construction error");