984 Commits

Author SHA1 Message Date
Björn Svensson
b044eaa6a7 Copy error to redisAsyncContext when finding subscribe cb 2022-08-29 13:34:27 +02:00
Michael Grunder
e0200b797b
Merge pull request #1087 from redis/const-and-non-const-callback
Maintain backward compatibiliy withour onConnect callback.
2022-08-26 10:35:38 -07:00
michael-grunder
6a3e96ad21 Maintain backward compatibiliy withour onConnect callback.
In f69fac7690fb22a7fc19dba61ef70e5f79ccb2e9, our async onConnect
callback was improved to take a non-const redisAsyncContext allowing it
to be reentrant.

Unfortunately, this is a breaking change we can't make until hiredis
v2.0.0.

This commit creates a separate callback member and corresponding
function that allows us to use the new functionality, while maintaining
our existing API for legacy code.

Fixes #1086
2022-08-26 10:14:47 -07:00
Michael Grunder
e7afd998f9
Merge pull request #1079 from SukkaW/drop-macos-10.15-runner
CI: bump macos runner version
2022-08-26 10:14:31 -07:00
Michael Grunder
17c8fe0798
Merge pull request #931 from kristjanvalur/pr2
Stability: Support calling redisAsyncCommand and redisAsyncDisconnect from the onConnected callback
2022-08-19 11:29:00 -07:00
Michael Grunder
b808c0c206
Merge pull request #1083 from chayim/ck-drafter
Support for generating release notes
2022-08-17 12:22:33 -07:00
Michael Grunder
367a82bf02
Merge pull request #1085 from stanhu/ssl-improve-options-setting
Make it possible to set SSL verify mode
2022-08-15 17:19:51 -07:00
Stan Hu
71119a71d7
Make it possible to set SSL verify mode
If no SSL certificates are provided, many Redis clients default to
disabling SSL peer verification. Previously it was a bit cumbersome to
configure this because the client would either have to reimplement
`redisCreateSSLContext()` or reach into the internals to set the
OpenSSL verify mode.

We can improve the SSL API by introducing a
`redisCreateSSLContextWithOptions()` call that takes into structured
parameters for SSL initialization. This structure contains a verify
mode that is used to set the OpenSSL verify mode.

Relates to https://github.com/redis/hiredis/issues/646
2022-08-15 11:21:44 -07:00
Michael Grunder
dd7979ac10
Merge pull request #1084 from stanhu/sh-improve-ssl-docs
Improve example for SSL initialization in README.md
2022-08-10 14:43:23 -07:00
Stan Hu
c71116178b
Improve example for SSL initialization in README.md
The previous example left `ssl_error`
uninitialized. `redisCreateSSLContex` is not guaranteed to set this
when no error occurs.

Use the `REDIS_SSL_CTX_NONE` constant instead of 0 to be precise.
2022-08-10 00:38:33 -07:00
Chayim I. Kirshen
5c9b6b571e Release drafter 2022-08-10 09:40:30 +03:00
Sukka
a606ccf2a5
CI: use recommended vmactions/freebsd-vm@v0
Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
2022-08-05 17:07:18 +08:00
Michael Grunder
0865c115ba
Merge pull request #1080 from Nordix/readme-corrections
Fix README typos
2022-08-04 09:18:26 -07:00
Björn Svensson
f6cee7142c Fix README typos 2022-08-04 12:07:14 +02:00
Michael Grunder
06be7ff312
Merge pull request #1050 from smmir-cent/fix-cmake-version
fix cmake version
2022-07-31 14:54:13 -07:00
SukkaW
7dd833d544 CI: bump macos runner version 2022-07-25 13:43:19 +08:00
Kristján Valur Jónsson
f69fac7690
Drop const on redisAsyncContext in redisConnectCallback
Since the callback is now re-entrant, it can call apis such as redisAsyncDisconnect()
2022-07-08 13:52:43 +00:00
Kristján Valur Jónsson
005d7edebe
Support calling redisAsyncDisconnect from the onConnected callback, by deferring context deletion 2022-07-08 13:52:22 +00:00
Kristján Valur Jónsson
6ed060920f
Add async regression test for issue #931 2022-07-08 13:52:22 +00:00
Michael Grunder
eaa2a7ee77
Merge pull request #932 from kristjanvalur/pr3
Polling adapter and example
2022-07-07 11:43:19 -07:00
Kristján Valur Jónsson
2ccef30f3e Add regression test for issue #945 2022-07-05 11:17:30 +00:00
Kristján Valur Jónsson
4b901d44ad Initial async tests 2022-07-05 11:17:30 +00:00
Kristján Valur Jónsson
31c91408ef Polling adapter and example 2022-07-05 11:14:03 +00:00
Michael Grunder
8a15f4d657
Merge pull request #1057 from orgads/static-name
Use the same name for static and shared libraries
2022-06-26 16:49:19 -07:00
Michael Grunder
902dd047fe
Merge pull request #1054 from kristjanvalur/pr08
Embed debug information in windows static .lib file
2022-06-26 16:07:34 -07:00
Michael Grunder
c78d0926bf
Merge pull request #1074 from michael-grunder/kristjanvalur-pr4
Improved async documentation
2022-06-26 15:42:00 -07:00
michael-grunder
2b115d56cd Whitespace 2022-06-26 14:42:31 -07:00
Kristján Valur Jónsson
1343988cee Fix typos 2022-06-26 14:42:08 -07:00
Kristján Valur Jónsson
47b57aa243 Add some documentation on connect/disconnect callbacks and command callbacks 2022-06-26 14:42:02 -07:00
Michael Grunder
a890d9ce20
Merge pull request #1073 from michael-grunder/kristjanvalur-pr1
Fix async connect on Windows
2022-06-26 14:23:12 -07:00
michael-grunder
f246ee433d Whitespace, style 2022-06-26 14:14:58 -07:00
Kristján Valur Jónsson
94c1985bde Use correct type for getsockopt() 2022-06-26 13:19:40 -07:00
Kristján Valur Jónsson
5e002bc21c Support failed async connects on windows. 2022-06-26 13:19:33 -07:00
Michael Grunder
5d68ad2f48
Merge pull request #1072 from michael-grunder/fix-redis7-unit-tests
Fix tests so they work for Redis 7.0
2022-06-26 12:18:54 -07:00
michael-grunder
f4b6ed2898 Fix tests so they work for Redis 7.0
* Redis >= 7.0.0 disables the `DEBUG` command by default, which we need
  for our unit tests.

* Downgrade to Redis 6.2.x in macOS temporarily

  There is a macOS specific TLS error on large payloads when running
  against 7.x.x so temporarily run our tests against 6.2, while we
  investigate the root cause.
2022-06-26 12:03:50 -07:00
Michael Grunder
95a0c1283a
Merge pull request #1058 from orgads/win64
Fix warnings on Win64
2022-05-04 12:22:29 -07:00
Orgad Shaneh
eedb37a65d Fix warnings on Win64
read.c:399:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  399 |                     obj = (void*)(long)cur->type;
      |                           ^
2022-04-24 13:12:30 +03:00
Michael Grunder
47c3ecefc0
Merge pull request #1062 from yossigo/fix-push-notification-order
Handle push notifications before or after reply.
2022-04-23 14:31:09 -07:00
Michael Grunder
e23d91c97b
Merge pull request #1061 from yossigo/update-redis-apt
Use official repository for redis package.
2022-04-23 14:21:22 -07:00
Michael Grunder
34211ad542
Merge pull request #1063 from redis/fix-windows-tests
Whitelist hiredis repo path in cygwin
2022-04-23 13:40:10 -07:00
michael-grunder
9957af7e3c Whitelist hiredis repo path in cygwin 2022-04-23 13:25:57 -07:00
Yossi Gottlieb
b455b33818 Handle push notifications before or after reply. 2022-04-22 15:35:55 +03:00
Yossi Gottlieb
aed9ce4462 Use official repository for redis package. 2022-04-22 15:20:04 +03:00
Michael Grunder
d7683f35aa
Merge pull request #1047 from Nordix/unsubscribe-handling
Unsubscribe handling in async
2022-04-05 13:00:54 -07:00
Michael Grunder
7c44a9d7ec
Merge pull request #1045 from Nordix/sds-updates
Update hiredis sds with improvements found in redis
2022-04-05 12:55:25 -07:00
Orgad Shaneh
dd4bf97836 Use the same name for static and shared libraries
On all system except MSVC, the targets are different.

Unix: libhiredis.so, libhiredis.a
MinGW: libhiredis.dll+libhiredis.dll.a, libhiredis.a
MSVC: hiredis.dll+hiredis.lib, hiredis_static.lib
2022-03-29 17:19:52 +03:00
Kristján Valur Jónsson
ff57c18b9e Embed debug information in windows static lib, rather than create a .pdb file
Using .pdb files with .lib files on windows is very inconvenient, particularly if the .lib
file is then linked as part of a different .dll.  Chances are that the original .pdb
will not be picked up or distributed along with the tooling.
2022-03-24 14:41:22 +00:00
smmir-cent
8310ad4f5c fix cmake version 2022-03-18 20:27:01 +00:00
Björn Svensson
7123b87f6d Handle any pipelined unsubscribe in async
Redis responds to an unsubscribe with one or many replies, depending
on the current subscribe state. When channels/patterns names are
provided in a command each given name will trigger a reply even if
duplicated or not subscribed to.
To know when we can return from the subscribed state we need to do
bookkeeping on pending additional unsubscribe replies, and make sure
we receive them all before switching state.
2022-02-03 09:26:01 +01:00
Björn Svensson
b6fb548fc6 Ignore pubsub replies without a channel/pattern 2022-02-02 23:43:21 +01:00