summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-04-07 15:44:47 -0400
committerMatt Stancliff <matt@genges.com>2014-04-08 19:37:45 -0400
commite35266e68fa2f9a292639eb7e499eace226101d0 (patch)
treebe1f70ba816d55a2c9391a38240f5af787bb48ab
parent7f0c7a29fd4d0f0623db522501c2b66eb8ebb94d (diff)
Stop redisCheckSocketError from more than checking
redisCheckSocketError should only CheckSocketError and not close any misbehaving sockets. If CheckSocketError discovers a problem, the caller will discover the contest is in ERR and will start destroying the context (which involves finalizing all callbacks (which may still be using fd for something, so we should not close fd until all callbacks have been told we are failing) and eventually close the fd in redisFree() immediately before the context is released).
-rw-r--r--net.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net.c b/net.c
index a591818..c26f4cc 100644
--- a/net.c
+++ b/net.c
@@ -226,14 +226,12 @@ int redisCheckSocketError(redisContext *c) {
if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, &err, &errlen) == -1) {
__redisSetErrorFromErrno(c,REDIS_ERR_IO,"getsockopt(SO_ERROR)");
- redisContextCloseFd(c);
return REDIS_ERR;
}
if (err) {
errno = err;
__redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL);
- redisContextCloseFd(c);
return REDIS_ERR;
}