diff options
author | Sangmoon Yi <jman@krafton.com> | 2019-08-12 10:55:08 +0900 |
---|---|---|
committer | Sangmoon Yi <jman@krafton.com> | 2019-08-12 10:55:08 +0900 |
commit | 8e61d5737a9123549298582a7b98207e2acd7f7c (patch) | |
tree | 12afb83665f5c221e7bc731fd37a2010e9da7ba0 | |
parent | ab1762cd92845a75663c9046a6c039cd9757eb39 (diff) |
add recv error code for clarifying timeout
-rw-r--r-- | net.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |