_Thanks to [Yossi Gottlieb](https://github.com/yossigo) for the security fix and to [Microsoft Security Vulnerability Research](https://www.microsoft.com/en-us/msrc/msvr) for finding the bug._ :sparkling_heart:
**This Readme reflects the latest changed in the master branch. See [v1.0.0](https://github.com/redis/hiredis/tree/v1.0.0) for the Readme and documentation for the latest release ([API/ABI history](https://abi-laboratory.pro/?view=timeline&l=hiredis)).**
**This Readme reflects the latest changed in the master branch. See [v1.0.0](https://github.com/redis/hiredis/tree/v1.0.0) for the Readme and documentation for the latest release ([API/ABI history](https://abi-laboratory.pro/?view=timeline&l=hiredis)).**
# HIREDIS
# HIREDIS
Hiredis is a minimalistic C client library for the [Redis](http://redis.io/) database.
Hiredis is a minimalistic C client library for the [Redis](https://redis.io/) database.
It is minimalistic because it just adds minimal support for the protocol, but
It is minimalistic because it just adds minimal support for the protocol, but
at the same time it uses a high level printf-alike API in order to make it
at the same time it uses a high level printf-alike API in order to make it
...
@@ -22,6 +23,12 @@ Redis version >= 1.2.0.
...
@@ -22,6 +23,12 @@ Redis version >= 1.2.0.
The library comes with multiple APIs. There is the
The library comes with multiple APIs. There is the
*synchronous API*, the *asynchronous API* and the *reply parsing API*.
*synchronous API*, the *asynchronous API* and the *reply parsing API*.
## Upgrading to `1.0.2`
<spanstyle="color:red">NOTE: v1.0.1 erroneously bumped SONAME, which is why it is skipped here.</span>
Version 1.0.2 is simply 1.0.0 with a fix for [CVE-2021-32765](https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2). They are otherwise identical.
## Upgrading to `1.0.0`
## Upgrading to `1.0.0`
Version 1.0.0 marks the first stable release of Hiredis.
Version 1.0.0 marks the first stable release of Hiredis.
...
@@ -169,7 +176,7 @@ Hiredis also supports every new `RESP3` data type which are as follows. For mor
...
@@ -169,7 +176,7 @@ Hiredis also supports every new `RESP3` data type which are as follows. For mor
***`REDIS_REPLY_MAP`**:
***`REDIS_REPLY_MAP`**:
* An array with the added invariant that there will always be an even number of elements.
* An array with the added invariant that there will always be an even number of elements.
The MAP is functionally equivelant to `REDIS_REPLY_ARRAY` except for the previously mentioned invariant.
The MAP is functionally equivalent to `REDIS_REPLY_ARRAY` except for the previously mentioned invariant.
***`REDIS_REPLY_SET`**:
***`REDIS_REPLY_SET`**:
* An array response where each entry is unique.
* An array response where each entry is unique.
...
@@ -189,7 +196,7 @@ Hiredis also supports every new `RESP3` data type which are as follows. For mor
...
@@ -189,7 +196,7 @@ Hiredis also supports every new `RESP3` data type which are as follows. For mor
***`REDIS_REPLY_VERB`**:
***`REDIS_REPLY_VERB`**:
* A verbatim string, intended to be presented to the user without modification.
* A verbatim string, intended to be presented to the user without modification.
The string payload is stored in the `str` memeber, and type data is stored in the `vtype` member (e.g. `txt` for raw text or `md` for markdown).
The string payload is stored in the `str` member, and type data is stored in the `vtype` member (e.g. `txt` for raw text or `md` for markdown).
Replies should be freed using the `freeReplyObject()` function.
Replies should be freed using the `freeReplyObject()` function.
Note that this function will take care of freeing sub-reply objects
Note that this function will take care of freeing sub-reply objects
...
@@ -261,9 +268,9 @@ a single call to `read(2)`):
...
@@ -261,9 +268,9 @@ a single call to `read(2)`):
redisReply*reply;
redisReply*reply;
redisAppendCommand(context,"SET foo bar");
redisAppendCommand(context,"SET foo bar");
redisAppendCommand(context,"GET foo");
redisAppendCommand(context,"GET foo");
redisGetReply(context,(void*)&reply);// reply for SET
redisGetReply(context,(void**)&reply);// reply for SET
freeReplyObject(reply);
freeReplyObject(reply);
redisGetReply(context,(void*)&reply);// reply for GET
redisGetReply(context,(void**)&reply);// reply for GET
freeReplyObject(reply);
freeReplyObject(reply);
```
```
This API can also be used to implement a blocking subscriber:
This API can also be used to implement a blocking subscriber:
...
@@ -517,7 +524,7 @@ initialize OpenSSL and create a context. You can do that in two ways:
...
@@ -517,7 +524,7 @@ initialize OpenSSL and create a context. You can do that in two ways:
/* An Hiredis SSL context. It holds SSL configuration and can be reused across
/* An Hiredis SSL context. It holds SSL configuration and can be reused across
* many contexts.
* many contexts.
*/
*/
redisSSLContext*ssl;
redisSSLContext*ssl_context;
/* An error variable to indicate what went wrong, if the context fails to
/* An error variable to indicate what went wrong, if the context fails to