Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d32fd315
Unverified
Commit
d32fd315
authored
May 09, 2021
by
Oran Agra
Committed by
GitHub
May 09, 2021
Browse files
redis-benchmark bad check for NOAUTH and NOPERM (#8931)
also, print errors to stderr rather than stdout
parent
56976ffb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
d32fd315
...
...
@@ -362,9 +362,9 @@ fail:
else
fprintf
(
stderr
,
"%s
\n
"
,
hostsocket
);
int
abort_test
=
0
;
if
(
reply
&&
reply
->
type
==
REDIS_REPLY_ERROR
&&
(
!
strncmp
(
reply
->
str
,
"NOAUTH"
,
5
)
||
(
!
strncmp
(
reply
->
str
,
"NOAUTH"
,
6
)
||
!
strncmp
(
reply
->
str
,
"WRONGPASS"
,
9
)
||
!
strncmp
(
reply
->
str
,
"NOPERM"
,
5
)))
!
strncmp
(
reply
->
str
,
"NOPERM"
,
6
)))
abort_test
=
1
;
freeReplyObject
(
reply
);
redisFree
(
c
);
...
...
@@ -530,21 +530,21 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
* before requesting the new configuration. */
fetch_slots
=
1
;
do_wait
=
1
;
printf
(
"Error from server %s:%d: %s.
\n
"
,
c
->
cluster_node
->
ip
,
c
->
cluster_node
->
port
,
r
->
str
);
f
printf
(
stderr
,
"Error from server %s:%d: %s.
\n
"
,
c
->
cluster_node
->
ip
,
c
->
cluster_node
->
port
,
r
->
str
);
}
if
(
do_wait
)
sleep
(
1
);
if
(
fetch_slots
&&
!
fetchClusterSlotsConfiguration
(
c
))
exit
(
1
);
}
else
{
if
(
c
->
cluster_node
)
{
printf
(
"Error from server %s:%d: %s
\n
"
,
c
->
cluster_node
->
ip
,
c
->
cluster_node
->
port
,
r
->
str
);
}
else
printf
(
"Error from server: %s
\n
"
,
r
->
str
);
f
printf
(
stderr
,
"Error from server %s:%d: %s
\n
"
,
c
->
cluster_node
->
ip
,
c
->
cluster_node
->
port
,
r
->
str
);
}
else
f
printf
(
stderr
,
"Error from server: %s
\n
"
,
r
->
str
);
exit
(
1
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment