summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangmoon Yi <jman@krafton.com>2019-08-12 10:55:08 +0900
committerSangmoon Yi <jman@krafton.com>2019-08-12 10:55:08 +0900
commit8e61d5737a9123549298582a7b98207e2acd7f7c (patch)
tree12afb83665f5c221e7bc731fd37a2010e9da7ba0
parentab1762cd92845a75663c9046a6c039cd9757eb39 (diff)
add recv error code for clarifying timeout
-rw-r--r--net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net.c b/net.c
index 6e7ac82..7cbfd32 100644
--- a/net.c
+++ b/net.c
@@ -63,6 +63,10 @@ int redisNetRead(redisContext *c, char *buf, size_t bufcap) {
if ((errno == EWOULDBLOCK && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) {
/* Try again later */
return 0;
+ } else if(errno == ETIMEDOUT && (c->flags & REDIS_BLOCK)) {
+ /* especially in windows */
+ __redisSetError(c, REDIS_ERR_TIMEOUT, "recv timeout");
+ return -1;
} else {
__redisSetError(c, REDIS_ERR_IO, NULL);
return -1;