Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Aug 19, 2023
1 parent 86e3262 commit da36488
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/redis/clients/jedis/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ private void initializeFromClientConfig(JedisClientConfig config) {

private void helloOrAuth(final RedisProtocol protocol, final RedisCredentials credentials,
final String clientName, final AtomicBoolean clientNamePending) {

if (credentials == null || credentials.getPassword() == null) {
if (protocol != null) {
sendCommand(Protocol.Command.HELLO, encode(protocol.version()));
Expand All @@ -485,13 +486,13 @@ private void helloOrAuth(final RedisProtocol protocol, final RedisCredentials cr
sendCommand(Protocol.Command.HELLO, encode(protocol.version()),
Protocol.Keyword.AUTH.getRaw(), encode(credentials.getUser()), rawPass);
}
getOne();
getOne(); // Map
clientNamePending.set(false);
} else { // getUser() == null
sendCommand(Protocol.Command.HELLO, encode(protocol.version()));
getOne();
sendCommand(Protocol.Command.AUTH, rawPass);
getOne();
getStatusCodeReply(); // OK
sendCommand(Protocol.Command.HELLO, encode(protocol.version()));
getOne(); // Map
}
} else { // protocol == null
if (credentials.getUser() != null) {
Expand Down

0 comments on commit da36488

Please sign in to comment.