Commit e35266e6 authored by Matt Stancliff's avatar Matt Stancliff
Browse files

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).
parent 7f0c7a29
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment