- 30 May, 2023 1 commit
-
-
Yossi Gottlieb authored
-
- 29 May, 2023 1 commit
-
-
Viktor Söderqvist authored
* Implement redisSetTcpUserTimeout to set socket option TCP_USER_TIMEOUT * Documentation for redisSetTcpUserTimeout and some more undocumented functions Documentation for redisReconnect() and the setters of socket options: * redisKeepAlive() * redisEnableKeepAliveWithInterval() * redisSetTcpUserTimeout()
-
- 14 Oct, 2022 1 commit
-
-
Bjorn Svensson authored
Improve coverage (#734) * Remove duplicate tests - double covered by: "Can parse RESP3 doubles" - bool covered via: "Can parse RESP3 bool" * Make (connect) timeout in test config general * Set error string in Unix connect with invalid timeout Restructure testcase since redisConnectWithTimeout() and redisConnectUnixWithTimeout() now behaves similar. * Use quiet flag in lcov/genhtml instead of piping to /dev/null * Fixup of redisCommandArgv test case * Update test case to match what it covers Use new test case info text since the previous one seemed copy&pasted. The sought coverage was the handling of the parent-chaining for a double object, which the test case now focuses on. Co-authored-by:
Ariel <ashtul@gmail.com>
-
- 05 Sep, 2022 1 commit
-
-
Michael Grunder authored
Fix ProtocolError This commit attempts to fix hiredis such that a recoverable write error will be retried rather than throwing a hard error. Since our read/write functions are now behind function pointers, we specify semantically that a return value of < 0 is a hard error, 0 a recoverable error, and > 0 a success. Our default `redisNetRead` function was already doing something similar so this also improves code consistency. Resolves #961 Co-authored-by:
Maksim Tuleika <maksim.tuleika@appcast.io>
-
- 03 Sep, 2022 1 commit
-
-
Michael Grunder authored
Use a windows specific keepalive function. While it is possible to toggle `TCP_KEEPALIVE` in windows via setsockopt, you have to use `WSAIoctl` to set the interval. Since `WSAIoctl` can actually do all of this in one call (toggle the option, and set the corresponding interval), just use that in Windows and avoid the call to `setsockopt` alltogether. Fixes: #1100
-
- 01 Sep, 2022 1 commit
-
-
Viktor Söderqvist authored
-
- 29 Aug, 2022 1 commit
-
-
Arseniy Simonov authored
-
- 26 Jun, 2022 3 commits
-
-
michael-grunder authored
-
Kristján Valur Jónsson authored
-
Kristján Valur Jónsson authored
-
- 26 Jul, 2020 1 commit
-
-
valentinogeron authored
Add an additional timeout so the user has a convenient way of controlling distinct connect and command timeouts
-
- 22 Jun, 2020 1 commit
-
-
OmriSteiner authored
Co-authored-by:
Omri Steiner <omri@insoundz.com>
-
- 07 Jun, 2020 1 commit
-
-
Michael Grunder authored
Fix overflow bug in `sdsrange`
-
- 22 May, 2020 1 commit
-
-
Michael Grunder authored
* Adds an indirection to every allocation/deallocation to allow users to plug in ones of their choosing (use custom functions, jemalloc, etc). * Gracefully handle OOM everywhere in hiredis. This should make it possible for users of the library to have more flexibility in how they handle such situations. * Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent a possible overflow when transferring the task elements into a `redisReply`. * Adds a configurable `max elements` member to `redisReader` that defaults to 2^32 - 1. This can be set to "unlimited" by setting the value to zero.
-
- 03 Apr, 2020 1 commit
-
-
Michael Grunder authored
Unit tests in Windows and a Windows timeout fix This commit gets our unit tests compiling and running on Windows as well as removes a duplicated `timeval` -> `DWORD` conversion logic in sockcompat.c There are minor differences in behavior between Linux and Windows to note: 1. In Windows, opening a non-existent hangs forever in WSAPoll whereas it correctly returns with a "Connection refused" error on Linux. For that reason, I simply skip this test in Windows. It may be related to this known issue: https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/ 2. Timeouts are handled slightly differently in Windows and Linux. In Linux, we intentionally set REDIS_ERR_IO for connection timeouts whereas in Windows we set REDIS_ERR_TIMEOUT. It may be prudent to fix this discrepancy although there are almost certainly users relying on the current behavior.
-
- 28 Jan, 2020 1 commit
-
-
Michael Grunder authored
Create allocation wrappers with a configurable OOM handler (defaults to abort()). See #752, #747
-
- 12 Aug, 2019 2 commits
-
-
Sangmoon Yi authored
-
Sangmoon Yi authored
-
- 03 Jul, 2019 1 commit
-
-
Quentin Young authored
-
- 01 Apr, 2019 4 commits
-
-
m authored
With this change, Hiredis builds with MinGW and runs on Windows.
-
m authored
The recv/send calls are more portable than read/write, since unlike the latter, the former work with Windows sockets. We also check for EWOULDBLOCK instead of EAGAIN. On most Unices, EAGAIN and EWOULDBLBOCK are the same thing. However, on Windows they are different, and send/recv are expected to give EWOULDBLOCK for non-blocking sockets.
-
m authored
The redisFD type should be equal to the system native socket file desciptor type (for POSIX, this is a plain int). We also introduce the REDIS_INVALID_FD value, which maps to -1 on POSIX systems.
-
m authored
This makes hiredis.c free from system calls related to socket I/O. This is also makes the treatment of raw socket connections more similar to the SSL backend.
-
- 20 Feb, 2019 2 commits
-
-
Mark Nunberg authored
-
Mark Nunberg authored
-
- 28 Jan, 2019 1 commit
-
-
Code Hz authored
-
- 05 Dec, 2018 1 commit
-
-
Mark Nunberg authored
-
- 26 Sep, 2018 3 commits
-
-
Mark Nunberg authored
-
Mark Nunberg authored
Not sizeof saddr.
-
Mark Nunberg authored
This retrieves the actual error which occurred, as getsockopt is not always reliable in this regard.
-
- 01 May, 2018 3 commits
-
-
Justin Brewer authored
free(NULL) is a valid NOP. Most of the hiredis free functions behave the same way. redisReaderFree is updated to also be NULL-safe. There is one redundant NULL check at sds.c:1036, but it's left as is since sds is imported from upstream. Signed-off-by:
Justin Brewer <jzb0012@auburn.edu>
-
Justin Brewer authored
freeaddrinfo is not required by POSIX to be NULL-safe. OpenBSD will SIGSEGV. NetBSD will assert. FreeBSD up to 11.1 will SIGSEGV, while in future versions, it will be a silent NOP [1]. Commit d4b715f0 ("Fix potential race in 'invalid timeout' tests") added a code path to _redisContextConnectTcp which calls freeaddrinfo(NULL), triggering the segfault. Put a NULL check around the call to freeaddrinfo. [1] - https://github.com/freebsd/freebsd/commit/e9167239034a1e475c3238f8d133ebf703424ee0 Signed-off-by:
Justin Brewer <jzb0012@auburn.edu>
-
Justin Brewer authored
Since _GNU_SOURCE is now guaranteed to be unset, it is no longer necessary to support the GNU-specific version of strerror_r. Drop __redis_strerror_r from the header, and call strerror_r directly. This breaks any external users of this macro, but they shouldn't have been using it in the first place. Signed-off-by:
Justin Brewer <jzb0012@auburn.edu>
-
- 28 Apr, 2018 2 commits
-
-
Justin Brewer authored
strerror_r and addrinfo require _POSIX_C_SOURCE >= 200112L, which is implied by _XOPEN_SOURCE >= 600. With the removal of AF_LOCAL usage, the only non-standard features being used are the TCP_KEEP* socket flags. _DARWIN_C_SOURCE is required to expose TCP_KEEPALIVE. Fall back to using _XOPEN_SOURCE 600 for all platforms, and additionally define _DARWIN_C_SOURCE for Darwin. Signed-off-by:
Justin Brewer <jzb0012@auburn.edu>
-
Justin Brewer authored
AF_LOCAL is the old, non-standardized name for AF_UNIX. Just use AF_UNIX, rather than wrestling with platform specifics of AF_LOCAL definitions. Signed-off-by:
Justin Brewer <jzb0012@auburn.edu>
-
- 15 Jun, 2017 1 commit
-
-
amallia authored
-
- 15 May, 2017 1 commit
-
-
Frederik Deweerdt authored
-
- 30 Dec, 2016 1 commit
-
-
Jin Qing authored
snprintf() may change errno.
-
- 07 Jul, 2016 1 commit
-
-
WSL authored
-
- 18 Nov, 2015 1 commit
-
-
Tom Lee authored
It's possible for the call to connect() to succeed on the very first try, in which case the logic for checking for invalid timeout fields is never executed. When this happens, the tests fail because they expect a REDIS_ERR_IO but no such failure has occurred. Tests aside, this is a potential source of irritating and hard-to-find intermittent bugs. This patch forces the validation to occur early so that we get predictable behavior whenever an invalid timeout is specified.
-