diff options
author | Mark Nunberg <mnunberg@haskalah.org> | 2018-12-13 11:24:40 -0500 |
---|---|---|
committer | Mark Nunberg <mnunberg@haskalah.org> | 2019-02-20 09:10:10 -0500 |
commit | 3a547b8ec045704bf4836d0c5c9657fa311698f0 (patch) | |
tree | ec0034d37726646c6993ab2bd1547a26fa89b9df | |
parent | f51363a70cdee179ed30b580f1e47b715cde06fb (diff) | |
download | hiredict-3a547b8ec045704bf4836d0c5c9657fa311698f0.tar.xz |
Unix: set addrlen so async reconnect uses proper size
-rw-r--r-- | net.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -502,7 +502,8 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time sa = (struct sockaddr_un*)(c->saddr = malloc(sizeof(struct sockaddr_un))); c->addrlen = sizeof(struct sockaddr_un); sa->sun_family = AF_UNIX; - strncpy(sa->sun_path,path,sizeof(sa->sun_path)-1); + c->addrlen = sizeof(*sa); + strncpy(sa->sun_path, path, sizeof(sa->sun_path) - 1); if (connect(c->fd, (struct sockaddr*)sa, sizeof(*sa)) == -1) { if (errno == EINPROGRESS && !blocking) { /* This is ok. */ |