add recv error code for clarifying timeout
This commit is contained in:
parent
ab1762cd92
commit
8e61d5737a
4
net.c
4
net.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user