Commit Graph

31 Commits (master)

Author SHA1 Message Date
jengab 0ed6cdec35 Fix some undefined behaviour
- redisSSLContextError must always be initialized at defintion,
  otherwise when SSL connect succeeds it may not be assigned to a valid error.
  Thus the memory trash remains in the variable, which may sign a misleading error.
2022-08-29 11:12:53 -07:00
Kristján Valur Jónsson 31c91408ef Polling adapter and example 2022-07-05 11:14:03 +00:00
MichaelSuen e73ab2f232
Add timeout support for libuv adapter (#1016)
Add timeout to libuv adapter

Co-authored-by: sunmingqi <sunmingqi@corp.netease.com>
Co-authored-by: sunmingqi <smq222@126.com>
Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
Co-authored-by: Viktor Söderqvist <viktor@zuiderkwast.se>
2022-01-18 10:59:18 -08:00
Björn Svensson a83f4b8905 Correct CMake warning for libevent adapter example 2021-11-18 09:14:39 -08:00
Michael Grunder 48696e7e5e
Don't use non-installed win32.h helper in examples (#863)
See: #862
2020-08-07 10:26:38 -07:00
Michael Grunder d8ff72387d
Move SSL management to a distinct private pointer. (#855)
We need to allow our users to use redisContext->privdata as context
for any RESP3 PUSH messages, which means we can't use it for managing
SSL connections.

Bulletpoints:

* Create a secondary redisContext member for internal use only called
  privctx and rename the redisContextFuncs->free_privdata accordingly.

* Adds a `free_privdata` function pointer so the user can tie allocated
  memory to the lifetime of a redisContext (like they can already do
  with redisAsyncContext)

* Enables SSL tests in .travis.yml
2020-07-29 11:53:03 -07:00
valentinogeron 38b5ae543f
add a command_timeout to redisContextOptions (#839)
Add an additional timeout so the user has a convenient way of controlling distinct connect and command timeouts
2020-07-26 12:32:27 -07:00
Michael Grunder 5a3c324138
Remove erroneous tag and add license to push example (#849) 2020-07-19 21:47:28 -07:00
Michael Grunder 2e7d7cbabd
Resp3 oob push support (#841)
Proper support for RESP3 PUSH messages.

By default, PUSH messages are now intercepted and the reply memory freed.  
This means existing code should work unchanged when connecting to Redis
>= 6.0.0 even if `CLIENT TRACKING` were then enabled.

Additionally, we define two callbacks users can configure if they wish to handle
these messages in a custom way:

void redisPushFn(void *privdata, void *reply);
void redisAsyncPushFn(redisAsyncContext *ac, void *reply);

See #825
2020-07-19 18:54:42 -07:00
Michael Grunder 1864e76ea7
Some Windows quality of life improvments. (#846)
* Don't try to ignore SIGPIPE in Windows (it doesn't exist).
* Add an include to our win32.h compatibility header.
* Enable building examples on Travis in Windows.

See #831
2020-07-10 12:53:52 -07:00
Yossi Gottlieb 190bca88d0 New SSL API to replace redisSecureConnection(). 2020-05-24 23:37:47 +03:00
Yossi Gottlieb dd408e8e3f Update CMakelists for hiredis/hiredis_ssl builds.
Also rename the SSL option from `HIREDIS_SSL` to `ENABLE_SSL` to conform
with CMake convnetions.
2019-09-01 13:47:39 +03:00
Yossi Gottlieb 8715ba5c82 wip: SSL code reorganization, see #705. 2019-08-29 22:09:37 +03:00
Mark Nunberg dc3c6ce85c build ssl example if ssl is enabled 2019-04-10 08:36:34 -04:00
valentino 58222c26f4 Support SNI 2019-02-20 09:10:10 -05:00
Mark Nunberg 7b705936f6 libevent-example: Use timeout 2019-02-20 09:10:10 -05:00
Mark Nunberg 08efa46599 SSL for async I/O 2019-02-20 09:10:10 -05:00
Mark Nunberg ba947bc93c Add SSL example 2019-02-20 09:10:10 -05:00
Mark Nunberg bbad21f5ca Add examples to CMakeLists 2019-02-20 05:01:08 -05:00
Mark Nunberg 8633a2f32e Allow connections to unix socket in example
To minimize code changes, a simple `u` (or UNIX, Unix, unix, etc -- as
long as the first character is u or U) is used as a marker for the
'port' argument. In this case, the hostname is interpreted to be the
path to the unix socket.
2018-12-05 07:02:26 -05:00
Sergey Polovko f932f0ed27 fix snprintf format string 2015-10-05 16:22:00 +03:00
Jan-Erik Rediger ded5374763 Fix a typo in the Mac OSX example 2015-07-27 23:19:41 +02:00
Dmitry Bakhvalov c18a564818 Added MacOS X addapter and corresponding example.
Added MacOS X support via CoreFoundation run loop.
2015-07-27 23:19:14 +02:00
Pietro Cerutti 4a632a6038 Make sure to disconnect the adapter in the destructor 2015-07-27 23:17:41 +02:00
Pietro Cerutti 8ef7d595ac Add Qt adapter and relative example. 2015-07-27 23:17:41 +02:00
Gergely Nagy 3b153cbf9d Add an Ivykis adapter
This adds a new adapter and an example for using hiredis with the ivykis
async I/O library.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-07-27 22:48:05 +02:00
Christian Hergert 0c9ff5bb03 Add GLib 2.0 adapter
[Cleaned up Makefile and header includes.  Didn't change crazy
coding style because it's the convention for GLib systems.]

Closes #83
Closes #71
2015-01-05 16:39:30 -05:00
antirez 253e796a59 example.c: it is now possible to specify server ip/port.
This makes possible to use the example with IPv6 addresses and/or with a
different Redis instance than 127.0.0.1:6379.
2013-07-11 10:25:48 +02:00
Wolfgang Richter 37a840dc2c Emphasize size_t length for %b formatting
Closes #121.
2013-07-10 23:05:39 -07:00
Rafael Zanella 6cf2e85bd2 Update example.c
Added a call to redisFree()

Closes #148.
2013-07-10 22:34:46 -07:00
Aaron Bedra c552ca6904 Move examples into their own folder
Closes #166.
2013-07-10 22:16:53 -07:00