From e35266e68fa2f9a292639eb7e499eace226101d0 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Mon, 7 Apr 2014 15:44:47 -0400 Subject: 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). --- net.c | 2 -- 1 file changed, 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; } -- cgit v1.2.3