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
hiredis
Commits
e13674dd
Commit
e13674dd
authored
Nov 03, 2010
by
Pieter Noordhuis
Browse files
Expose redisGetReplyFromReader as public API
parent
314c0484
Changes
2
Show whitespace changes
Inline
Side-by-side
hiredis.c
View file @
e13674dd
...
@@ -744,7 +744,7 @@ int redisBufferWrite(redisContext *c, int *done) {
...
@@ -744,7 +744,7 @@ int redisBufferWrite(redisContext *c, int *done) {
/* Internal helper function to try and get a reply from the reader,
/* Internal helper function to try and get a reply from the reader,
* or set an error in the context otherwise. */
* or set an error in the context otherwise. */
static
int
__
redisGetReply
(
redisContext
*
c
,
void
**
reply
)
{
int
redisGetReply
FromReader
(
redisContext
*
c
,
void
**
reply
)
{
__redisCreateReplyReader
(
c
);
__redisCreateReplyReader
(
c
);
if
(
redisReplyReaderGetReply
(
c
->
reader
,
reply
)
==
REDIS_ERR
)
{
if
(
redisReplyReaderGetReply
(
c
->
reader
,
reply
)
==
REDIS_ERR
)
{
__redisSetError
(
c
,
REDIS_ERR_PROTOCOL
,
__redisSetError
(
c
,
REDIS_ERR_PROTOCOL
,
...
@@ -759,7 +759,7 @@ int redisGetReply(redisContext *c, void **reply) {
...
@@ -759,7 +759,7 @@ int redisGetReply(redisContext *c, void **reply) {
void
*
aux
=
NULL
;
void
*
aux
=
NULL
;
/* Try to read pending replies */
/* Try to read pending replies */
if
(
__
redisGetReply
(
c
,
&
aux
)
==
REDIS_ERR
)
if
(
redisGetReply
FromReader
(
c
,
&
aux
)
==
REDIS_ERR
)
return
REDIS_ERR
;
return
REDIS_ERR
;
/* For the blocking context, flush output buffer and read reply */
/* For the blocking context, flush output buffer and read reply */
...
@@ -774,7 +774,7 @@ int redisGetReply(redisContext *c, void **reply) {
...
@@ -774,7 +774,7 @@ int redisGetReply(redisContext *c, void **reply) {
do
{
do
{
if
(
redisBufferRead
(
c
)
==
REDIS_ERR
)
if
(
redisBufferRead
(
c
)
==
REDIS_ERR
)
return
REDIS_ERR
;
return
REDIS_ERR
;
if
(
__
redisGetReply
(
c
,
&
aux
)
==
REDIS_ERR
)
if
(
redisGetReply
FromReader
(
c
,
&
aux
)
==
REDIS_ERR
)
return
REDIS_ERR
;
return
REDIS_ERR
;
}
while
(
aux
==
NULL
);
}
while
(
aux
==
NULL
);
}
}
...
...
hiredis.h
View file @
e13674dd
...
@@ -130,6 +130,7 @@ int redisBufferWrite(redisContext *c, int *done);
...
@@ -130,6 +130,7 @@ int redisBufferWrite(redisContext *c, int *done);
* buffer to the socket and reads until it has a reply. In a non-blocking
* buffer to the socket and reads until it has a reply. In a non-blocking
* context, it will return unconsumed replies until there are no more. */
* context, it will return unconsumed replies until there are no more. */
int
redisGetReply
(
redisContext
*
c
,
void
**
reply
);
int
redisGetReply
(
redisContext
*
c
,
void
**
reply
);
int
redisGetReplyFromReader
(
redisContext
*
c
,
void
**
reply
);
/* Write a command to the output buffer. Use these functions in blocking mode
/* Write a command to the output buffer. Use these functions in blocking mode
* to get a pipeline of commands. */
* to get a pipeline of commands. */
...
...
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