diff options
author | zhenwei pi <pizhenwei@bytedance.com> | 2022-07-27 11:53:56 +0800 |
---|---|---|
committer | zhenwei pi <pizhenwei@bytedance.com> | 2022-08-22 15:12:31 +0800 |
commit | eb94d6d36dec7323af5fb89a5899506d5c07adb1 (patch) | |
tree | b0bd52ded9538761e9b59304980f88622d781d0d /src/connection.c | |
parent | 0ae02ce95b8a27ce9d19340e53dcdc9b5a060101 (diff) | |
download | redis-eb94d6d36dec7323af5fb89a5899506d5c07adb1.tar.gz |
Introduce unix socket connection type
Unix socket uses different accept handler/create listener from TCP,
to hide these difference to avoid hard code, use a new unix socket
connection type. Also move 'acceptUnixHandler' into unix.c.
Currently, the connection framework becomes like following:
uplayer
|
connection layer
/ | \
TCP Unix TLS
It's possible to build Unix socket support as a shared library, and
load it dynamically. Because TCP and Unix socket don't require any
heavy dependencies or overheads, we build them into Redis statically.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 72db82212..33e0c03c1 100644 --- a/src/connection.c +++ b/src/connection.c @@ -56,6 +56,9 @@ int connTypeInitialize() { /* currently socket connection type is necessary */ serverAssert(RedisRegisterConnectionTypeSocket() == C_OK); + /* currently unix socket connection type is necessary */ + serverAssert(RedisRegisterConnectionTypeUnix() == C_OK); + /* may fail if without BUILD_TLS=yes */ RedisRegisterConnectionTypeTLS(); |