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
8e61d573
"examples/example-libuv.c" did not exist on "97920b443e58aa9c15f9836841164c7123194859"
Commit
8e61d573
authored
Aug 12, 2019
by
Sangmoon Yi
Browse files
add recv error code for clarifying timeout
parent
ab1762cd
Changes
1
Show whitespace changes
Inline
Side-by-side
net.c
View file @
8e61d573
...
@@ -63,6 +63,10 @@ int redisNetRead(redisContext *c, char *buf, size_t bufcap) {
...
@@ -63,6 +63,10 @@ int redisNetRead(redisContext *c, char *buf, size_t bufcap) {
if
((
errno
==
EWOULDBLOCK
&&
!
(
c
->
flags
&
REDIS_BLOCK
))
||
(
errno
==
EINTR
))
{
if
((
errno
==
EWOULDBLOCK
&&
!
(
c
->
flags
&
REDIS_BLOCK
))
||
(
errno
==
EINTR
))
{
/* Try again later */
/* Try again later */
return
0
;
return
0
;
}
else
if
(
errno
==
ETIMEDOUT
&&
(
c
->
flags
&
REDIS_BLOCK
))
{
/* especially in windows */
__redisSetError
(
c
,
REDIS_ERR_TIMEOUT
,
"recv timeout"
);
return
-
1
;
}
else
{
}
else
{
__redisSetError
(
c
,
REDIS_ERR_IO
,
NULL
);
__redisSetError
(
c
,
REDIS_ERR_IO
,
NULL
);
return
-
1
;
return
-
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