Skip to content

Commit

Permalink
Reset error flag for the rediscontext struct
Browse files Browse the repository at this point in the history
  • Loading branch information
vin01 authored and chr4 committed Sep 9, 2019
1 parent cb4e676 commit cec1f28
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deps/hiredis/net.c
Expand Up @@ -411,6 +411,15 @@ static int _redisContextConnectTcp(redisContext *c, const char *addr, int port,

c->flags |= REDIS_CONNECTED;

/* This is needed because c->err is set using __redisSetError on
* connection failures. This can be called by various functions.
* We shall have a clear function that would ideally clean the struct
* of all past errors which have been put into or somehow only set the
* error flag and message after looping through all IP addresses and
* not finding any REDIS_OK.
*/
c->err = 0;

freeaddrinfo(servinfo);
return REDIS_OK; // Need to return REDIS_OK if alright
}
Expand Down

0 comments on commit cec1f28

Please sign in to comment.