• zhenwei pi's avatar
    Fully abstract connection type · 1234e3a5
    zhenwei pi authored
    
    
    Abstract common interface of connection type, so Redis can hide the
    implementation and uplayer only calls connection API without macro.
    
                   uplayer
                      |
               connection layer
                 /          \
              socket        TLS
    
    Currently, for both socket and TLS, all the methods of connection type
    are declared as static functions.
    
    It's possible to build TLS(even socket) as a shared library, and Redis
    loads it dynamically in the next step.
    
    Also add helper function connTypeOfCluster() and
    connTypeOfReplication() to simplify the code:
    link->conn = server.tls_cluster ? connCreateTLS() : connCreateSocket();
    -> link->conn = connCreate(connTypeOfCluster());
    Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
    1234e3a5
networking.c 169 KB