mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Identify client on connect (#2708)
* Update CLIENT-SETINFO to support suffixes * Update CLIENT-SETINFO * fix acl log test * add setinfo option to cluster * change to DisableIndentity * change to DisableIndentity
This commit is contained in:
9
redis.go
9
redis.go
@ -299,7 +299,14 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
|
||||
// difficult to rely on error strings to determine all results.
|
||||
return err
|
||||
}
|
||||
|
||||
if !c.opt.DisableIndentity {
|
||||
libName := ""
|
||||
libVer := Version()
|
||||
libInfo := LibraryInfo{LibName: &libName}
|
||||
conn.ClientSetInfo(ctx, libInfo)
|
||||
libInfo = LibraryInfo{LibVer: &libVer}
|
||||
conn.ClientSetInfo(ctx, libInfo)
|
||||
}
|
||||
_, err := conn.Pipelined(ctx, func(pipe Pipeliner) error {
|
||||
if !auth && password != "" {
|
||||
if username != "" {
|
||||
|
Reference in New Issue
Block a user