• Chen Tianjie's avatar
    Use server.current_client to decide whether cluster commands should return TLS info. (#12569) · 3f6bd4fc
    Chen Tianjie authored
    Starting a change in #12233 (released in 7.2), CLUSTER commands use client's
    connection to decide whether to return TLS port or non-TLS port, but commands
    called by Lua script and module's RM_Call don't have a real client with connection,
    and would currently be regarded as non-TLS connections.
    
    We can use server.current_client instead when it is available. When it is not (module calls
    commands without a real client), we may see this as an undefined behavior, and return null
    or default port (currently in this PR it returns default port, judged by server.tls_cluster).
    
    (cherry picked from commit 2aad03fa)
    3f6bd4fc
cluster.c 302 KB