Skip to content

Commit

Permalink
fix: ClientNoEvict and ClientSetInfo causing DisableCache malfunction
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Jul 24, 2023
1 parent af14e15 commit e357475
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,6 @@ func _newPipe(connFn func() (net.Conn, error), option *ClientOption, r2ps bool)
} else {
init = append(init, helloCmd, append([]string{"CLIENT", "TRACKING", "ON"}, option.ClientTrackingOptions...))
}
if option.ClientNoEvict {
init = append(init, []string{"CLIENT", "NO-EVICT", "ON"})
}
if option.ClientSetInfo != nil {
clientSetInfoCmd := []string{"CLIENT", "SETINFO"}
clientSetInfoCmd = append(clientSetInfoCmd, option.ClientSetInfo...)
init = append(init, clientSetInfoCmd)
}
if option.DisableCache {
init = init[:1]
}
Expand All @@ -181,6 +173,12 @@ func _newPipe(connFn func() (net.Conn, error), option *ClientOption, r2ps bool)
if option.ClientNoTouch {
init = append(init, []string{"CLIENT", "NO-TOUCH", "ON"})
}
if option.ClientNoEvict {
init = append(init, []string{"CLIENT", "NO-EVICT", "ON"})
}
if option.ClientSetInfo != nil {
init = append(init, append([]string{"CLIENT", "SETINFO"}, option.ClientSetInfo...))
}

timeout := option.Dialer.Timeout
if timeout <= 0 {
Expand Down

0 comments on commit e357475

Please sign in to comment.