• antirez's avatar
    UNSUBSCRIBE and PUNSUBSCRIBE: always provide a reply. · 3ff75e58
    antirez authored
    UNSUBSCRIBE and PUNSUBSCRIBE commands are designed to mass-unsubscribe
    the client respectively all the channels and patters if called without
    arguments.
    
    However when these functions are called without arguments, but there are
    no channels or patters we are subscribed to, the old behavior was to
    don't reply at all.
    
    This behavior is broken, as every command should always reply.
    Also it is possible that we are no longer subscribed to a channels but we
    are subscribed to patters or the other way around, and the client should
    be notified with the correct number of subscriptions.
    
    Also it is not pretty that sometimes we did not receive a reply at all
    in a redis-cli session from these commands, blocking redis-cli trying
    to read the reply.
    
    This fixes issue #714.
    3ff75e58
pubsub.tcl 6.63 KB