Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
bc5dcdbc
Commit
bc5dcdbc
authored
Oct 30, 2010
by
Pieter Noordhuis
Browse files
Status replies should have type REDIS_REPLY_STATUS
parent
171b5a24
Changes
2
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
bc5dcdbc
...
...
@@ -118,10 +118,6 @@ static void *createStringObject(redisReadTask *task, char *str, size_t len) {
r
->
str
=
value
;
r
->
len
=
len
;
/* for API compat, set STATUS to STRING */
if
(
task
->
type
==
REDIS_REPLY_STATUS
)
r
->
type
=
REDIS_REPLY_STRING
;
if
(
task
->
parent
)
{
redisReply
*
parent
=
task
->
parent
;
assert
(
parent
->
type
==
REDIS_REPLY_ARRAY
);
...
...
test.c
View file @
bc5dcdbc
...
...
@@ -44,7 +44,7 @@ static void test_blocking_connection() {
__connect
(
&
c
);
/* reconnect */
test
(
"Is able to deliver commands: "
);
reply
=
redisCommand
(
c
,
"PING"
);
test_cond
(
reply
->
type
==
REDIS_REPLY_ST
RING
&&
test_cond
(
reply
->
type
==
REDIS_REPLY_ST
ATUS
&&
strcasecmp
(
reply
->
str
,
"pong"
)
==
0
)
freeReplyObject
(
reply
);
...
...
@@ -65,7 +65,7 @@ static void test_blocking_connection() {
test
(
"Is a able to send commands verbatim: "
);
reply
=
redisCommand
(
c
,
"SET foo bar"
);
test_cond
(
reply
->
type
==
REDIS_REPLY_ST
RING
&&
test_cond
(
reply
->
type
==
REDIS_REPLY_ST
ATUS
&&
strcasecmp
(
reply
->
str
,
"ok"
)
==
0
)
freeReplyObject
(
reply
);
...
...
@@ -122,7 +122,7 @@ static void test_blocking_connection() {
reply
->
element
[
0
]
->
elements
==
2
&&
!
memcmp
(
reply
->
element
[
0
]
->
element
[
0
]
->
str
,
"bar"
,
3
)
&&
!
memcmp
(
reply
->
element
[
0
]
->
element
[
1
]
->
str
,
"foo"
,
3
)
&&
reply
->
element
[
1
]
->
type
==
REDIS_REPLY_ST
RING
&&
reply
->
element
[
1
]
->
type
==
REDIS_REPLY_ST
ATUS
&&
strcasecmp
(
reply
->
element
[
1
]
->
str
,
"pong"
)
==
0
);
freeReplyObject
(
reply
);
}
...
...
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