summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md2
-rw-r--r--async.c8
-rw-r--r--net.c4
-rw-r--r--read.c5
-rw-r--r--sds.c2
-rw-r--r--test.c1
7 files changed, 16 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8c8071..30140bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,10 @@ INSTALL(TARGETS hiredis
INSTALL(FILES hiredis.h read.h sds.h async.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
-
+
+INSTALL(DIRECTORY adapters
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
+
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/README.md b/README.md
index 01223ea..e757d07 100644
--- a/README.md
+++ b/README.md
@@ -406,6 +406,6 @@ as soon as possible in order to prevent allocation of useless memory.
## AUTHORS
Hiredis was written by Salvatore Sanfilippo (antirez at gmail) and
-Pieter Noordhuis (pcnoordhuis at gmail) and is released under the BSD license.
+Pieter Noordhuis (pcnoordhuis at gmail) and is released under the BSD license.
Hiredis is currently maintained by Matt Stancliff (matt at genges dot com) and
Jan-Erik Rediger (janerik at fnordig dot com)
diff --git a/async.c b/async.c
index 50eb2d9..171fabd 100644
--- a/async.c
+++ b/async.c
@@ -34,8 +34,8 @@
#include <string.h>
#ifndef _WIN32
#include <strings.h>
-#else
-#define strcasecmp stricmp
+#else
+#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
#include <assert.h>
@@ -438,7 +438,7 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply,
assert(reply->element[2]->type == REDIS_REPLY_INTEGER);
/* Unset subscribed flag only when no pipelined pending subscribe. */
- if (reply->element[2]->integer == 0
+ if (reply->element[2]->integer == 0
&& dictSize(ac->sub.channels) == 0
&& dictSize(ac->sub.patterns) == 0)
c->flags &= ~REDIS_SUBSCRIBED;
@@ -557,7 +557,7 @@ static int __redisAsyncHandleConnect(redisAsyncContext *ac) {
/**
* Handle SSL when socket becomes available for reading. This also handles
* read-while-write and write-while-read.
- *
+ *
* These functions will not work properly unless `HIREDIS_SSL` is defined
* (however, they will compile)
*/
diff --git a/net.c b/net.c
index ac304b4..255f435 100644
--- a/net.c
+++ b/net.c
@@ -435,9 +435,7 @@ addrretry:
}
/* For repeat connection */
- if (c->saddr) {
- free(c->saddr);
- }
+ free(c->saddr);
c->saddr = malloc(p->ai_addrlen);
memcpy(c->saddr, p->ai_addr, p->ai_addrlen);
c->addrlen = p->ai_addrlen;
diff --git a/read.c b/read.c
index cc21267..065b0b5 100644
--- a/read.c
+++ b/read.c
@@ -590,8 +590,11 @@ int redisReaderGetReply(redisReader *r, void **reply) {
/* Emit a reply when there is one. */
if (r->ridx == -1) {
- if (reply != NULL)
+ if (reply != NULL) {
*reply = r->reply;
+ } else if (r->reply != NULL && r->fn && r->fn->freeObject) {
+ r->fn->freeObject(r->reply);
+ }
r->reply = NULL;
}
return REDIS_OK;
diff --git a/sds.c b/sds.c
index 44777b1..6cf7584 100644
--- a/sds.c
+++ b/sds.c
@@ -1035,7 +1035,7 @@ sds *sdssplitargs(const char *line, int *argc) {
s_free(vector);
return NULL;
}
-
+
vector = new_vector;
vector[*argc] = current;
(*argc)++;
diff --git a/test.c b/test.c
index 4af99b2..05c5ee3 100644
--- a/test.c
+++ b/test.c
@@ -450,6 +450,7 @@ static void test_blocking_connection_errors(void) {
c->err == REDIS_ERR_OTHER &&
(strcmp(c->errstr, "Name or service not known") == 0 ||
strcmp(c->errstr, "Can't resolve: " HIREDIS_BAD_DOMAIN) == 0 ||
+ strcmp(c->errstr, "Name does not resolve") == 0 ||
strcmp(c->errstr,
"nodename nor servname provided, or not known") == 0 ||
strcmp(c->errstr, "No address associated with hostname") == 0 ||