- 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.
-
- 30 Apr, 2015 1 commit
-
-
Alex Balashov authored
Renamed redisContext struct member 'unix' to 'unix_sock' to avoid encountering defined constant 'unix' in GNU C environment (see commit d8145d79). Not all code using hiredis can compile using '-std=c99', and/or not all users are able to easily make that change to the build process of various open-source projects, so it is more pragmatic to choose a different identifier that does not impose this requirement.
-
- 16 Apr, 2015 2 commits
-
-
Jan-Erik Rediger authored
-
Jan-Erik Rediger authored
Originally implemented by @abedra as part of #306. In case a write or read times out, we force an error state, because we can't guarantuee that the next read will get the right data. Instead we need to reconnect to have a clean-state connection, which is now easily possible with this method.
-
- 05 Jan, 2015 3 commits
-
-
Matt Stancliff authored
The strerror_r API has two flavors depending on system options. The bad flavor uses a static buffer for returning results, so if you save the pointer from strerror_r, the string you're referencing becomes useless if anybody else calls strerror_r again The good flavor does what you expect: it writes the error to your buffer. This commit uses strerror_r directly if it's a good version or copies the static buffer into our private buffer if it's a bad version. Thanks to gemorin for explaining the problem and drafting a fix. Fixes #239
-
Chris Lamb authored
Signed-off-by:
Chris Lamb <chris@chris-lamb.co.uk> [Instead of checking for "not solaris" we feature detect for availability of what we want, then remove the system that advertises compatability but doesn't actually provide it (given our assumptions about what we're guarding).] Closes #254
-
mike authored
[This introduces some new API functions.] * Adds new flag to the connection context indicating SO_REUSEADDR should be set. * Adds max number of retries constant for when connect() hits EADDRNOTAVAIL. * Adds new function, redisAsyncConnectBindWithReuse(), letting clients enable this functionality. [Removed trailing whitespace in new header lines.] Closes #264
-
- 18 Sep, 2014 1 commit
-
-
Matt Stancliff authored
See antirez/redis#2012 for the leak causing unbounded memory growth.
-
- 10 Apr, 2014 2 commits
-
-
Pieter Noordhuis authored
-
Pieter Noordhuis authored
-
- 09 Apr, 2014 1 commit
-
-
Matt Stancliff authored
Solaris doesn't define the TCP options we try to set. Let's ignore those under Solaris. Closes #207
-
- 08 Apr, 2014 3 commits
-
-
Matt Stancliff authored
Some environments require binding to specific source addresses instead of letting the system determine which IP a connection should originate from. Closes #233
-
Matt Stancliff authored
redisCheckSocketError should only CheckSocketError and not close any misbehaving sockets. If CheckSocketError discovers a problem, the caller will discover the contest is in ERR and will start destroying the context (which involves finalizing all callbacks (which may still be using fd for something, so we should not close fd until all callbacks have been told we are failing) and eventually close the fd in redisFree() immediately before the context is released).
-
Matt Stancliff authored
With all the async connects and disconnects and error handling going on in hiredis, we need to centralize how we close our fd and set it so it doesn't get re-closed. Prior to this commit, sometimes we'd close(fd), run an async error handler, then call close(fd) again. To stop multiple closes, we now set fd to -1 after we free it, but that requires not passing fd as an independent argument to functions. This commit moves all fd usage to c->fd. Since the context has a fd field and all functions receive the context, it makes more sense to use the fd inside of c instead of passing along fd as an independent argument. Also, by only using c->fd, we can set c->fd after we close it to signify we shouldn't re-close the same fd again. This does change one semi-public interface function redisCheckSocketError() to only take (context) instead of (context, fd). A search on github returned zero occasions of people using redisCheckSocketError() outside of net.{c,h} in hiredis itself. Commit inspired by the bug report at: https://groups.google.com/forum/#!topic/redis-db/mQm46XkIPOY Thanks go out to Thijs for trying high-frequency reconnects on a host that isn't there. Closes #230
-
- 11 Jul, 2013 2 commits
-
-
antirez authored
redisContextConnectTcp() is now able to use IPv6 addresses if there is no IPv4 address found resolving the specified hostname.
-
Noah Williamsson authored
The struct timeval argument in redisConnectWithTimeout(), redisConnectUnixWithTimeout(), redisSetTimeout(), redisContextSetTimeout(), redisContextConnectTcp() and redisContextConnectUnix() is never modified and can therefore be marked as const. Signed-off-by:
Noah Williamsson <noah.williamsson@gmail.com>
-