Mercurial > hgrepos > FreeBSD > ports > net > turnserver
comparison files/patch-src_apps_common_hiredis__libevent2.c @ 26:4e4af36a675a
Update to GH version 4.6.0.
On the first look: compiles ok, plist ok, packages ok.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 07 Nov 2022 09:33:38 +0100 |
| parents | 735b41782ed7 |
| children |
comparison
equal
deleted
inserted
replaced
| 25:82a6a52479ea | 26:4e4af36a675a |
|---|---|
| 1 --- src/apps/common/hiredis_libevent2.c.orig 2021-01-10 19:59:55 UTC | 1 --- src/apps/common/hiredis_libevent2.c.orig 2022-09-13 07:33:12 UTC |
| 2 +++ src/apps/common/hiredis_libevent2.c | 2 +++ src/apps/common/hiredis_libevent2.c |
| 3 @@ -55,6 +55,7 @@ struct redisLibeventEvents | 3 @@ -55,6 +55,7 @@ struct redisLibeventEvents |
| 4 char *ip; | 4 char *ip; |
| 5 int port; | 5 int port; |
| 6 char *pwd; | 6 char *pwd; |
| 35 + ac = redisAsyncConnectUnix(sockpath); | 35 + ac = redisAsyncConnectUnix(sockpath); |
| 36 + } else { | 36 + } else { |
| 37 + ac = redisAsyncConnect(ip, port); | 37 + ac = redisAsyncConnect(ip, port); |
| 38 + } | 38 + } |
| 39 if (!ac) { | 39 if (!ac) { |
| 40 fprintf(stderr,"Error: %s:%s\n", ac->errstr, ac->c.errstr); | 40 fprintf(stderr,"Error: redisAsyncConnect returned NULL\n"); |
| 41 return NULL; | 41 return NULL; |
| 42 @@ -256,6 +265,11 @@ redis_context_handle redisLibeventAttach(struct event_ | 42 @@ -260,6 +269,11 @@ redis_context_handle redisLibeventAttach(struct event_ |
| 43 e->port = port; | 43 e->port = port; |
| 44 if(pwd) | 44 if(pwd) |
| 45 e->pwd = strdup(pwd); | 45 e->pwd = strdup(pwd); |
| 46 + if(usocket) { | 46 + if(usocket) { |
| 47 + e->usocket = strdup(usocket); | 47 + e->usocket = strdup(usocket); |
| 49 + e->usocket = NULL; | 49 + e->usocket = NULL; |
| 50 + } | 50 + } |
| 51 e->db = db; | 51 e->db = db; |
| 52 | 52 |
| 53 /* Register functions to start/stop listening for events */ | 53 /* Register functions to start/stop listening for events */ |
| 54 @@ -277,6 +291,12 @@ redis_context_handle redisLibeventAttach(struct event_ | 54 @@ -281,6 +295,12 @@ redis_context_handle redisLibeventAttach(struct event_ |
| 55 e); | 55 e); |
| 56 | 56 |
| 57 if (e->rev == NULL || e->wev == NULL) { | 57 if (e->rev == NULL || e->wev == NULL) { |
| 58 + if(e->rev) | 58 + if(e->rev) |
| 59 + event_free(e->rev); | 59 + event_free(e->rev); |
| 62 + free(e->ip); | 62 + free(e->ip); |
| 63 + free(e->pwd); | 63 + free(e->pwd); |
| 64 free(e); | 64 free(e); |
| 65 return NULL; | 65 return NULL; |
| 66 } | 66 } |
| 67 @@ -327,7 +347,11 @@ static void redis_reconnect(struct redisLibeventEvents | 67 @@ -331,7 +351,11 @@ static void redis_reconnect(struct redisLibeventEvents |
| 68 e->context = NULL; | 68 e->context = NULL; |
| 69 } | 69 } |
| 70 | 70 |
| 71 - ac = redisAsyncConnect(e->ip, e->port); | 71 - ac = redisAsyncConnect(e->ip, e->port); |
| 72 + if(e->usocket) { | 72 + if(e->usocket) { |
